Unit tests #62
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 | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18.x | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | |
- uses: actions/cache@v2 | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- uses: sergioramos/yarn-actions/install@master | |
with: | |
frozen-lockfile: true | |
- name: Install playwright dependencies | |
run: | | |
sudo -HE env DEBIAN_FRONTEND=noninteractive apt-get --option Dpkg::Options::=--force-confnew -qy --no-install-recommends --allow-downgrades --allow-remove-essential --allow-change-held-packages install \ | |
fonts-ipafont-gothic \ | |
fonts-liberation \ | |
fonts-tlwg-loma-otf \ | |
fonts-wqy-zenhei \ | |
libdrm2 \ | |
libfontconfig \ | |
libfreetype6 \ | |
libgbm1 \ | |
msttcorefonts \ | |
ttf-ubuntu-font-family \ | |
xfonts-cyrillic \ | |
xfonts-scalable \ | |
&& true | |
npx playwright install --with-deps chromium | |
- 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 [ -z "$TRANSLOADIT_ACCESS_KEY" ]; then | |
echo "TRANSLOADIT_ACCESS_KEY is not set. Skipping E2E tests." | |
else | |
yarn test:e2e | |
fi | |
- name: Upload Coverage Report | |
if: ${{ always() }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage-report | |
path: coverage |