Merge pull request #27 from regexident/node-v20 #53
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: "units-test" | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
- 'releases/*' | |
jobs: | |
# unit tests | |
units: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: npm ci | |
- run: npm test | |
# test action works running from the graph | |
test: | |
runs-on: ubuntu-latest | |
outputs: | |
use-runner: ${{ steps.test-action.outputs.use-runner }} | |
steps: | |
- uses: actions/checkout@v4 | |
- id: test-action | |
uses: ./ | |
with: | |
primary-runner: 'self-hosted,linux' | |
fallback-runner: 'ubuntu-latest' | |
github-token: ${{ secrets.TEST_GITHUB_TOKEN }} | |
- name: Check output | |
run: echo "Runner to use is ${{ steps.test-action.outputs.use-runner }}" | |
test-output: | |
needs: test | |
runs-on: ${{ fromJson(needs.test.outputs.use-runner )}} | |
steps: | |
- name: Do something | |
run: echo "Doing something on ${{ needs.test.outputs.use-runner }}" | |
test-multiple-labels: | |
runs-on: ubuntu-latest | |
outputs: | |
use-runner: ${{ steps.test-action.outputs.use-runner }} | |
steps: | |
- uses: actions/checkout@v4 | |
- id: test-action | |
uses: ./ | |
with: | |
primary-runner: 'self-hosted,linux' | |
fallback-runner: 'linux,x64' | |
github-token: ${{ secrets.TEST_GITHUB_TOKEN }} | |
- name: Check output | |
run: echo "Runner to use is ${{ steps.test-action.outputs.use-runner }}" |