From 97f4dc1abb10cbc82980867307323c22c438e407 Mon Sep 17 00:00:00 2001 From: Axel Adlercreutz <39679469+DoebelnAtz@users.noreply.github.com> Date: Fri, 17 Jan 2025 12:51:01 +0200 Subject: [PATCH] add gh workflow (#1) * add gh workflow * cache node_modules * cache subdir --- .github/workflows/github-actions.yml | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/github-actions.yml diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml new file mode 100644 index 0000000..3bf4fbe --- /dev/null +++ b/.github/workflows/github-actions.yml @@ -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"