Skip to content

Commit

Permalink
Github action for cloud code checks (#816)
Browse files Browse the repository at this point in the history
  • Loading branch information
chriswilty committed Mar 19, 2024
1 parent 5d7c903 commit 3add2e3
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 20 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/backend-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
strategy:
matrix:
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -30,19 +29,21 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache-dependency-path: "./backend/package-lock.json"
- name: Run job
cache: 'npm'
cache-dependency-path: './backend/package-lock.json'
- name: Install dependencies
run: |
npm ci
- name: Run job
run: |
npx eslint .
npx prettier . --check
build-test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 18.x ]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -52,10 +53,12 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache-dependency-path: "./backend/package-lock.json"
- name: Run job
cache: 'npm'
cache-dependency-path: './backend/package-lock.json'
- name: Install dependencies
run: |
npm ci
- name: Run job
run: |
npm run build
npm test
42 changes: 42 additions & 0 deletions .github/workflows/cloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Cloud Code Checks

on:
workflow_dispatch:
pull_request:
branches:
- main
- dev
- 'feature/+'
paths:
- 'cloud/**'

defaults:
run:
working-directory: ./cloud

jobs:
code-checks:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
sparse-checkout: |
.prettierrc
cloud
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: './cloud/package-lock.json'
- name: Install dependencies
run: |
npm ci
- name: Run job
run: |
npm run lint
npm run format
19 changes: 11 additions & 8 deletions .github/workflows/frontend-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
strategy:
matrix:
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -30,20 +29,22 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache-dependency-path: "./frontend/package-lock.json"
- name: Run job
cache: 'npm'
cache-dependency-path: './frontend/package-lock.json'
- name: Install dependencies
run: |
npm ci
- name: Run job
run: |
npx eslint .
npx stylelint '**/*.css'
npx prettier . --check
build-test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 18.x ]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -53,10 +54,12 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache-dependency-path: "./frontend/package-lock.json"
- name: Run job
cache: 'npm'
cache-dependency-path: './frontend/package-lock.json'
- name: Install dependencies
run: |
npm ci
- name: Run job
run: |
npm run build
npm test
9 changes: 5 additions & 4 deletions .github/workflows/k6-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
strategy:
matrix:
node-version: [18.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -30,10 +29,12 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache-dependency-path: "./k6/package-lock.json"
- name: Run job
cache: 'npm'
cache-dependency-path: './k6/package-lock.json'
- name: Install dependencies
run: |
npm ci
- name: Run job
run: |
npx eslint .
npx prettier . --check

0 comments on commit 3add2e3

Please sign in to comment.