Skip to content

Commit

Permalink
Adding GitHub checks
Browse files Browse the repository at this point in the history
Co-authored-by: MayanjaAndrew <68685849+MayanjaAndrew@users.noreply.github.com>
  • Loading branch information
gitstart and MayanjaAndrew committed Jun 29, 2023
1 parent d9247b8 commit a282907
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Setup"
description: "Sets up environment"
inputs:
ssh-private-key:
description: "SSH key used for private git clone"
required: true
runs:
using: "composite"
steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: "18.13.0"
cache: "npm"
registry-url: "https://npm.pkg.github.com"
- name: Install dependencies
run: |
npm install --immutable --immutable-cache --check-cache
shell: bash
59 changes: 59 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: CI/CD Checks

on:
push:
branches: [main]
pull_request:

jobs:
format-check:
runs-on: ubuntu-latest

steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Setup environment (node, npm install)
uses: ./.github/actions/setup
- name: Format check
run: npm run format:check

build-check:
runs-on: ubuntu-latest

steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Setup environment (node, npm install)
uses: ./.github/actions/setup
- name: Build check
run: npm run build

server-test:
services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: pg
POSTGRES_DB: flow_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432

runs-on: ubuntu-latest
timeout-minutes: 5
env:
DATABASE_URL: postgresql://postgres@localhost:5432/flow

steps:
- name: Check out repository code
uses: actions/checkout@v3
- name: Setup environment (node, npm install)
uses: ./.github/actions/setup
- name: Prisma Gen
run: npm run gen -w apps/server
- name: Test check
run: npm run test -w apps/server

0 comments on commit a282907

Please sign in to comment.