add gh workflow (#1)

* add gh workflow

* cache node_modules

* cache subdir
This commit is contained in:
Axel Adlercreutz
2025-01-17 12:51:01 +02:00
committed by GitHub
parent 1e88b5065d
commit 97f4dc1abb
+33
View File
@@ -0,0 +1,33 @@
name: Lint, format and test (and deploy)
on:
pull_request:
types: [opened, reopened, synchronize]
push:
branches:
- master
jobs:
lint-format-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Start databases
run: docker compose up -d
- name: Cache Node.js modules
uses: actions/cache@v3
with:
path: ./client/node_modules
key: ${{ runner.os }}-node-${{ hashFiles('./client/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Node
uses: actions/setup-node@v4
with:
cache-dependency-path: ./client/package-lock.json
node-version: 22.6
cache: "npm"
- name: Install client dependencies
run: npm install
working-directory: ./client
- name: Run tests
run: echo "All good"