Fixing the version response and a bug in the dedupe logic #484
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
on: | |
push: | |
branches: [main] | |
pull_request: | |
# The branches below must be a subset of the branches above | |
branches: [main] | |
name: Test Node | |
jobs: | |
test: | |
name: Test on node ${{ matrix.node-version }} and ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
node-version: [18.x, 20.x] | |
os: [ubuntu-latest] | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: ~/.npm | |
key: ${{ matrix.os }}-node-${{ matrix.node-version }}-npm-${{ hashFiles('package-lock.json') }} | |
restore-keys: ${{ matrix.os }}-node-${{ matrix.node-version }}-npm- | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install deps | |
run: npm ci --omit=dev | |
- name: build | |
run: npm run build --if-present | |
- name: lint | |
run: npm run lint | |
- name: test | |
run: npm test | |
- name: Check Test File Exists | |
if: success() || failure() | |
id: hasTests | |
run: | | |
if compgen -G "TestResults/*" > /dev/null; then | |
hasTest=true | |
else | |
hasTest=false | |
fi | |
echo "hasTests=$hasTest" >> $GITHUB_OUTPUT | |
- name: Test Reporter | |
id: test-report | |
if: ${{ steps.hasTests.outputs.hasTests == 'true' }} | |
uses: phoenix-actions/test-reporting@v12 | |
with: | |
name: ${{ github.event.repository.full_name }} Test Results | |
path: TestResults/test.xml | |
reporter: jest-junit | |
output-to: step-summary |