Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test new workflow #1003

Merged
merged 2 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: Node.js CI
name: Main

on:
push:
branches:
- main
paths:
- frontend/**
- queue/**
Expand Down Expand Up @@ -67,7 +69,7 @@ jobs:
run: yarn lint

- name: Test
run: yarn test --since --parallel --include-dependents
run: yarn test --parallel
env:
LOG_LEVEL: fatal
REACT_APP_API_URL: http://localhost:3001
Expand Down Expand Up @@ -102,31 +104,3 @@ jobs:
alias: queue-staging
branch: main
secrets: inherit

deploy-front-production:
uses: ./.github/workflows/deploy.yml
needs: [build]
with:
app: Front production
alias: front-production
branch: prod
environment: Production
secrets: inherit

deploy-api-production:
uses: ./.github/workflows/deploy.yml
needs: [build]
with:
app: API production
alias: api-production
branch: prod
secrets: inherit

deploy-queue-production:
uses: ./.github/workflows/deploy.yml
needs: [build]
with:
app: Queue production
alias: queue-production
branch: prod
secrets: inherit
79 changes: 79 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Pull request

on:
pull_request:
branches-ignore:
- prod
paths:
- frontend/**
- queue/**
- server/**
- packages/**

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20.x]
services:
postgres:
image: postgis/postgis
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: zlv
ports:
- 5432:5432
redis:
image: redis:7.2.4-alpine
ports:
- 6379:6379
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
s3:
image: adobe/s3mock:3.5.2
ports:
- 9090:9090
env:
initialBuckets: "zerologementvacant"

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Enable Corepack
run: corepack enable

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: yarn

- name: Install
run: yarn install --immutable
env:
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: true

- name: Build
run: yarn build
env:
DISABLE_ESLINT_PLUGIN: true
METABASE_TOKEN: token

- name: Lint
run: yarn lint

- name: Test
run: yarn test --since ${{ github.base_ref }} --parallel --include-dependents
env:
LOG_LEVEL: fatal
REACT_APP_API_URL: http://localhost:3001

- name: Test database migrations
run: yarn workspace @zerologementvacant/server run test:migrations --run-in-band
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,38 @@ on:
push:
branches:
- prod
paths:
- frontend/**
- queue/**
- server/**
- packages/**

jobs:
deploy-front-production:
uses: ./.github/workflows/deploy.yml
with:
app: Front production
alias: front-production
branch: prod
environment: Production
secrets: inherit

deploy-api-production:
uses: ./.github/workflows/deploy.yml
with:
app: API production
alias: api-production
branch: prod
secrets: inherit

deploy-queue-production:
uses: ./.github/workflows/deploy.yml
with:
app: Queue production
alias: queue-production
branch: prod
secrets: inherit

release:
runs-on: ubuntu-latest
steps:
Expand Down
Loading