Unit tests #82
Workflow file for this run
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: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
env: | |
SKIP_YARN_COREPACK_CHECK: true | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- name: Cache apt packages | |
uses: actions/cache@v3 | |
with: | |
path: /var/cache/apt/archives | |
key: ${{ runner.os }}-apt-${{ hashFiles('**/package.json') }} | |
restore-keys: | | |
${{ runner.os }}-apt- | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20.x' | |
cache: 'yarn' | |
- name: Enable Corepack | |
run: corepack enable | |
- name: Install Dependencies | |
run: yarn install --immutable | |
- name: Cache Playwright browsers | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/ms-playwright | |
key: ${{ runner.os }}-playwright-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-playwright- | |
- name: Lint | |
run: yarn lint | |
- name: Build | |
run: yarn build | |
- name: Run Unit Tests | |
run: yarn test:unit | |
- name: E2E Test | |
env: | |
TRANSLOADIT_ACCESS_KEY: '${{ secrets.TRANSLOADIT_ACCESS_KEY }}' | |
run: | | |
if [ "${TRANSLOADIT_ACCESS_KEY}" = "" ]; then | |
echo "TRANSLOADIT_ACCESS_KEY is not set. Skipping E2E tests." | |
else | |
npx playwright install --with-deps chromium | |
yarn test:e2e | |
fi | |
- name: Upload Coverage Report | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-report | |
path: coverage |