Cache Beebop databases in CI #699
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: jest CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
- "bacpop-*" | |
jobs: | |
unit_frontend: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./app/client-v2 | |
strategy: | |
matrix: | |
node-version: [20.x] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "npm" | |
cache-dependency-path: ./app/client-v2/package-lock.json | |
- run: npm ci | |
- name: Run unit tests | |
run: npm run test:coverage | |
- name: Upload coverage to codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
unit_and_integration_backend: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: ./app/server | |
strategy: | |
matrix: | |
node-version: [20.x] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Login to GHCR (GitHub Packages) | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: "npm" | |
cache-dependency-path: ./app/server/package-lock.json | |
- run: npm ci | |
- name: get config file | |
run: | | |
pwd | |
cp ./src/resources/config.json.in.development ./src/resources/config.json | |
- name: Restore DB Cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ github.workspace }}/storage/dbs | |
key: db-cache-${{ runner.os }} | |
restore-keys: | | |
db-cache- | |
- name: run dependencies | |
working-directory: . | |
run: ./scripts/run_dependencies ${{ github.workspace }}/storage/dbs | |
- name: run server | |
working-directory: . | |
run: ./scripts/run_test server-only | |
- name: Run unit and integration tests | |
run: npm run test | |
- name: Save DB Cache | |
uses: actions/cache@v3 | |
with: | |
path: ${{ github.workspace }}/storage/dbs | |
key: db-cache-${{ runner.os }} | |
- name: stop all components | |
working-directory: . | |
run: ./scripts/stop_test server-only |