Skip to content

feat: move app to its own repository #1

feat: move app to its own repository

feat: move app to its own repository #1

name: Run Tests
on:
pull_request:
branches:
- dev
jobs:
otp-provider-test:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Cache Node dependencies
uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: ${{ runner.os }}-yarn-
- name: Install asdf requirements
run: |
sudo apt-get install -y libssl-dev libreadline-dev uuid-dev
- name: Install asdf
uses: asdf-vm/actions/setup@v3
- name: Cache asdf tools
uses: actions/cache@v4
with:
path: |
/home/runner/.asdf
key: ${{ runner.os }}-${{ hashFiles('.tool-versions') }}
- name: Install app specific asdf plugins
run: |
cat .tool-versions | cut -f 1 -d ' ' | xargs -n 1 asdf plugin-add || true
asdf plugin-update --all
asdf install
asdf reshim
working-directory: .
- name: Install dependencies
run: yarn install
working-directory: .
- name: Setup postgres
env:
PGUSER: postgres
run: |
pg_ctl start
createdb runner || true
chmod +x ./db-setup.sh
psql -U postgres -c 'drop database if exists otp_test';
./db-setup.sh otp_test
working-directory: ./.bin
- name: Run unit tests
run: |
yarn test
working-directory: .
- name: Cache Playwright browsers
uses: actions/cache@v3
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-playwright-
- name: Install Playwright Browsers
run: yarn playwright install --with-deps
working-directory: .
- name: Migrate DB
run: |
yarn tailwind:build
yarn build
DB_NAME=otp_test node ./build/migrate.js
working-directory: .
- name: Seed DB
run: psql -U postgres -d otp_test -f ./seed.sql
working-directory: ./e2e
- name: Run Playwright tests
run: DB_NAME=otp_test yarn playwright test
working-directory: .
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: ./playwright-report/
retention-days: 30