Skip to content

Commit

Permalink
ci: make it job level
Browse files Browse the repository at this point in the history
  • Loading branch information
pixincreate committed Dec 2, 2024
1 parent 02af25d commit a053edf
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/cypress-tests-runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,50 +24,43 @@ env:
jobs:
formatter:
name: Run formatter on Cypress tests and address lints
if: ${{ ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name)) }}
runs-on: ubuntu-latest
steps:
- name: Generate a token
if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
id: generate_token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ secrets.HYPERSWITCH_BOT_APP_ID }}
private-key: ${{ secrets.HYPERSWITCH_BOT_APP_PRIVATE_KEY }}

- name: Checkout repository with token
if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
token: ${{ steps.generate_token.outputs.token }}

- name: Checkout repository for fork
if: ${{ github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }}
uses: actions/checkout@v4

- name: Install Node.js
if: ${{ env.RUN_TESTS == 'true' }}
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install Cypress and dependencies
if: ${{ env.RUN_TESTS == 'true' }}
run: |
npm ci --prefix ./cypress-tests
- name: Check formatting for forked pull requests
if: ${{ github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }}
shell: bash
run: |
# Checks return exit code 1 if failed and hence we use `|| true` to avoid failing the check
npm run format:check --prefix cypress-tests || true
npm run lint --prefix cypress-tests || true
- name: Check formatting
if: ${{ env.RUN_TESTS == 'true' }}
shell: bash
run: |
npm run format --prefix cypress-tests
Expand Down

0 comments on commit a053edf

Please sign in to comment.