Use v4 checkout action across the board (#13) #39
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
setup: | |
name: "Setup environment and determine templates" | |
runs-on: ubuntu-latest | |
outputs: | |
template_dirs: ${{ steps.get-dirs.outputs.dirs }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: npm | |
- name: Install Node.js dependencies | |
run: npm ci | |
- name: Get list of test directories | |
id: get-dirs | |
run: echo "dirs=$(ls -d test/*/ | jq -R -s -c 'split("\n")[:-1] | map(split("/")[1])')" >> $GITHUB_OUTPUT | |
lint: | |
name: "Run linting" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Run linting | |
run: test/lint.sh | |
test-templates: | |
name: "Run template tests" | |
needs: setup | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
template: ${{ fromJson(needs.setup.outputs.template_dirs) }} | |
fail-fast: false | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: npm | |
- name: Install Node.js dependencies | |
run: npm ci | |
- name: Run test for ${{ matrix.template }} | |
run: test/${{ matrix.template }}/test.sh |