Skip to content

Commit

Permalink
Re-add missing code quality steps
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-va committed Jul 22, 2024
1 parent 55af2b9 commit 048e2f4
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 2 deletions.
100 changes: 99 additions & 1 deletion .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres?schema=public

jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Review Dependencies
uses: actions/dependency-review-action@v4

install:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -55,10 +63,100 @@ jobs:
- name: Install e2e node dependencies
run: cd e2e && npm ci

test:
runs-on: ubuntu-latest
needs: install
services:
db:
image: postgis/postgis
ports:
- "5432:5432"
env:
POSTGRES_USER: ${{ env.DB_USERNAME }}
POSTGRES_PASSWORD: ${{ env.DB_PASSWORD }}
POSTGRES_DB: ${{ env.DB_DATABASE }}
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.12.1
ports:
- "9200:9200"
env:
ES_JAVA_OPTS: -Xms512m -Xmx512m
xpack.security.enabled: false
discovery.type: single-node
cluster.routing.allocation.disk.threshold_enabled: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Restore cached node modules
uses: actions/cache/restore@v4
with:
path: ./node_modules
key: "${{ runner.os }}-node_modules-${{ hashFiles('package-lock.json') }}-${{ hashFiles('**/schema.prisma') }}"
- name: Migrate database
run: npm run prisma -- migrate deploy
- name: Run tests
run: npm run test

lint:
runs-on: ubuntu-latest
needs: install
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Restore cached node modules
uses: actions/cache/restore@v4
with:
path: ./node_modules
key: "${{ runner.os }}-node_modules-${{ hashFiles('package-lock.json') }}-${{ hashFiles('**/schema.prisma') }}"
- name: Run lint
run: npm run lint
- name: Run prettier
run: npx prettier --check .

# It would be cleaner and probably more performant to replace this build step
# with either a non-emitting build or a simple type check.
# We only have `build` available for now,
# since the project is currently split across a multitude of small packages,
# all of which have to specify their own commands.
# (Daniel von Atzigen, 2024-04-12)
build:
runs-on: ubuntu-latest
needs:
- test
- lint
- dependency-review
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Restore cached node modules
uses: actions/cache/restore@v4
with:
path: ./node_modules
key: "${{ runner.os }}-node_modules-${{ hashFiles('package-lock.json') }}-${{ hashFiles('**/schema.prisma') }}"
- name: Reset nx
run: npx nx reset
- name: Run build
run: npm run build

cypress:
runs-on: ubuntu-latest
needs:
- install
- test
- lint
- dependency-review
strategy:
# https://github.com/cypress-io/github-action/issues/48
fail-fast: false
Expand Down
2 changes: 1 addition & 1 deletion e2e/cypress/e2e/create-elastic-index.feature
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Feature: Elastic index

Background:
Given The user is logged in
Given User has admin permissions
And User has admin permissions

Scenario: User creates elastic index
When A user clicks administration menu button
Expand Down

0 comments on commit 048e2f4

Please sign in to comment.