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: Test | ||
on: [workflow_call] | ||
jobs: | ||
test: | ||
runs-on: ubuntu-22.04 | ||
services: | ||
postgres: | ||
image: postgres | ||
env: | ||
POSTGRES_USER: postgres | ||
POSTGRES_DB: ylitse | ||
POSTGRES_PASSWORD: secret | ||
ports: | ||
- 5432:5432 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up node | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16.x' | ||
cache: npm | ||
- name: Install deps | ||
run: npm ci | ||
- name: Lint | ||
run: npm run lint | ||
- name: Run unit tests | ||
run: npm run test:unit | ||
- name: Clone the back end | ||
run: git clone https://gitlab.com/ylitse/ylitse-api | ||
- name: Set up python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
cache: pip | ||
cache-dependency-path: ylitse-api/requirements.txt | ||
# - name: Set up the back end | ||
# run: | | ||
# make env | ||
# source env/bin/activate | ||
# YLITSE_POSTGRES_URL=postgresql://postgres:secret@postgres/ylitse make conf | ||
# working-directory: ylitse-api | ||
- name: Build backend-image, create conf and run migrations | ||
run: | | ||
make build-image | ||
NEW_PG_HOST=postgres make image-conf | ||
cat ./ylitse_conf/ylitse.conf | ||
docker run --rm \ | ||
-v $(pwd)/ylitse_conf:/app/ylitse_conf \ | ||
-v $(pwd)/alembic:/app/alembic \ | ||
ylitse make db-upgrade-head && make-db-insert-admin | ||
working-directory: ./ylitse-api | ||
- name: Cache cypress | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.cache/Cypress | ||
key: cypress-${{ runner.os }}-${{ hashFiles('**/package-lock.json') }} | ||
- name: Run E2E tests | ||
run: | | ||
${{ github.workspace }}/.github/scripts/start-api & | ||
npm run start & | ||
npm run test:e2e |