Skip to content

Commit

Permalink
Implement database infra utilities and tests for api (#118, #122)
Browse files Browse the repository at this point in the history
- Adds unit and functional tests for api
- Adds docker compose with db init script to seed from dump
- Updates READMEs with relevant instructions
  • Loading branch information
ygrishajev committed Mar 14, 2024
1 parent 856c968 commit 14323ba
Showing 1 changed file with 35 additions and 3 deletions.
38 changes: 35 additions & 3 deletions .github/workflows/validate-n-build-api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: ["main"]

jobs:
build:
validate-n-build:
runs-on: ubuntu-latest

steps:
Expand All @@ -24,12 +24,44 @@ jobs:
shared:
- 'shared/**'
- name: Check node_modules cache
id: deps-cache
uses: martijnhols/actions-cache/check@v3
env:
cache-name: api-deps-cache
with:
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install Dependencies
if: steps.deps-cache.outputs.cache-hit != 'true'
run: |
cd api
npm install
- name: Cache node modules
if: steps.deps-cache.outputs.cache-hit != 'true'
uses: actions/cache@v3
env:
cache-name: api-deps-cache
with:
path: node_modules
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Validate API
if: steps.filter.outputs.api == 'true' || steps.filter.outputs.shared == 'true'
run: |
cd api
npm install
npm run test:unit
npm test:unit
- name: Build the Docker image for API
if: steps.filter.outputs.api == 'true' || steps.filter.outputs.shared == 'true'
Expand Down

0 comments on commit 14323ba

Please sign in to comment.