Skip to content

chore: cache docker images #113

chore: cache docker images

chore: cache docker images #113

Workflow file for this run

name: Test
on: [push, pull_request]
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: docker/setup-buildx-action@v2
- uses: docker/build-push-action@v4
with:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
- run: |
cp docker/dev/.env.example docker/dev/.env
cp server/.env.example server/.env
docker compose up -d
- name: setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- uses: actions/cache@v2
id: root-npm-cache
with:
path: 'node_modules'
key: root-npm-${{ hashFiles('package-lock.json') }}
- uses: actions/cache@v2
id: client-npm-cache
with:
path: 'client/node_modules'
key: client-npm-${{ hashFiles('client/package-lock.json') }}
- uses: actions/cache@v2
id: server-npm-cache
with:
path: 'server/node_modules'
key: server-npm-${{ hashFiles('server/package-lock.json') }}
- run: npm install & npm install --prefix client & npm install --prefix server & wait
if: steps.root-npm-cache.outputs.cache-hit != 'true' || steps.client-npm-cache.outputs.cache-hit != 'true' || steps.server-npm-cache.outputs.cache-hit != 'true'
- run: npm run generate
- run: npm run lint
- run: npm run typecheck
- run: cp client/.env.example client/.env
- run: npm test