Merge pull request #1291 from FNNDSC/update-pacs-page #626
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: test | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
jobs: | |
test-unit: | |
name: Tests (unit tests) | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: "0" # necessary for `npm run print-version` | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.17 | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Unit tests | |
run: npm test | |
# note to self: the sections test-public and test-local should be almost the same, except: | |
# - local testing needs git submodules | |
# - `npm run test:e2e` v.s. `npm run test:e2e:local` | |
# - some names should be different | |
test-public: | |
name: Tests (public testing server) | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: "0" # necessary for `npm run print-version` | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.17 | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Install Playwright Browsers | |
run: npx playwright install --with-deps | |
- name: End-to-End tests | |
env: | |
TEST_SAFARI: yes | |
run: npm run test:e2e | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: playwright-report | |
path: playwright-report-public/ | |
retention-days: 30 | |
- name: Report coverage | |
id: report | |
if: always() | |
run: npm run test:lcov | |
- name: Upload E2E test coverage | |
if: steps.report.outcome == 'success' | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: coverage/lcov.info | |
flags: e2etests-public | |
fail_ci_if_error: true | |
test-local: | |
name: Tests (local testing server) | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: "0" # necessary for `npm run print-version` | |
submodules: "recursive" # necessary for miniChRIS and example-dicoms | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20.17 | |
cache: 'npm' | |
- name: Install dependencies | |
run: npm ci | |
- name: Install Playwright Browsers | |
run: npx playwright install --with-deps | |
- name: Setup tests | |
run: npm run test:prepare | |
- name: End-to-End tests | |
env: | |
TEST_SAFARI: yes | |
run: npm run test:e2e:local | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: playwright-report | |
path: playwright-report-local/ | |
retention-days: 30 | |
- name: Report coverage | |
id: report | |
if: always() | |
run: npm run test:lcov | |
- name: Upload E2E test coverage | |
if: steps.report.outcome == 'success' | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: coverage/lcov.info | |
flags: e2etests-local | |
fail_ci_if_error: true |