Skip to content

Commit

Permalink
replaced several jobs for a matrix of tests
Browse files Browse the repository at this point in the history
It's cleaner and more straightforward
  • Loading branch information
Bullrich committed Apr 23, 2024
1 parent 9041479 commit 02cd4e3
Showing 1 changed file with 22 additions and 42 deletions.
64 changes: 22 additions & 42 deletions .github/workflows/javascript-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,55 +3,35 @@ name: Continuous testing
on: [pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use node 20
uses: actions/setup-node@v3
with:
node-version: 20
- uses: c-hive/gha-yarn-cache@v2
- name: Install dependencies
run: yarn install --frozen-lockfile
- run: yarn run lint

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use node 20
uses: actions/setup-node@v3
with:
node-version: 20
- uses: c-hive/gha-yarn-cache@v2
- name: Install dependencies
run: yarn install --frozen-lockfile
- run: yarn run build

test:
strategy:
matrix:
command: [lint, build, test, "cli '.github/review-bot.yml'"]
runs-on: ubuntu-latest
name: running ${{ matrix.command }}
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- name: Use node 20
uses: actions/setup-node@v3
- uses: actions/[email protected]
- uses: actions/[email protected]
with:
node-version: 20
- uses: c-hive/gha-yarn-cache@v2
- name: Cache node modules
id: cache-npm
uses: actions/[email protected]
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-build-${{ env.cache-name }}-
- name: Install dependencies
run: yarn install --frozen-lockfile
- run: yarn run test
- run: yarn run ${{ matrix.command }}

evaluate-config:
conclude:
runs-on: ubuntu-latest
name: All tests passed
needs: [test]
steps:
- uses: actions/checkout@v3
- name: Use node 20
uses: actions/setup-node@v3
with:
node-version: 20
- uses: c-hive/gha-yarn-cache@v2
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Evaluates config file
run: yarn run cli ".github/review-bot.yml"
- run: echo '### Good job! All the tests passed 🚀' >> $GITHUB_STEP_SUMMARY

0 comments on commit 02cd4e3

Please sign in to comment.