rename core repositories. Cheat on lint-staged. #623
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: Sensecraft CI | |
on: | |
push: | |
branches: | |
- dev | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js 18.18.2 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.18.2 | |
- name: use postgres | |
uses: Daniel-Marynicz/postgresql-action@master | |
with: | |
postgres_image_tag: 16.0-alpine-jwt | |
postgres_image_name: conversence/postgres | |
- name: Install client components | |
run: | | |
sudo apt update | |
sudo apt install -y postgresql-client wget golang-go | |
go install github.com/mailhog/MailHog@latest | |
echo "${HOME}/go/bin" >> $GITHUB_PATH | |
- name: Initialize test DB | |
working-directory: ./server | |
run: python ./scripts/initial_setup.py -u postgres -p postgres --no-create-development --no-create-production --app_name sensecraft | |
- name: install postgrest | |
run: | | |
wget https://github.com/PostgREST/postgrest/releases/download/v11.2.2/postgrest-v11.2.2-linux-static-x64.tar.xz | |
tar -Jxf postgrest-v11.2.2-linux-static-x64.tar.xz | |
rm postgrest-v11.2.2-linux-static-x64.tar.xz | |
sudo mv postgrest /usr/bin/ | |
- name: Install server dependencies | |
working-directory: ./server | |
run: npm ci | |
- name: Build dispatcher | |
working-directory: ./server | |
run: npm run build | |
- name: Run server tests | |
working-directory: ./server | |
run: npm run test | |
- name: Install client dependencies | |
working-directory: ./client | |
run: | | |
npm ci | |
npx @puppeteer/browsers install chrome@stable | |
npx @puppeteer/browsers install chromedriver@stable | |
- name: Run client unit tests | |
working-directory: ./client | |
run: npm run test:unit | |
- name: Run scoring tests | |
working-directory: ./client | |
run: npm run test:scoring | |
- name: Run integration tests | |
working-directory: ./client | |
run: npm run test:integration | |
- name: cleanup postgres container | |
run: | | |
export PGCONT=`docker ps -q --filter ancestor=conversence/postgres:16.0-alpine-jwt` | |
if [[-n $PGCONT]] | |
then | |
docker container stop $PGCONT | |
docker container rm $PGCONT | |
fi |