-
Notifications
You must be signed in to change notification settings - Fork 2
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
Adding GitHub checks #7
Changes from 1 commit
a282907
d46d61a
2b835e1
2a318f2
550c32a
15bed82
69607bb
cbe85ba
b8d0f1e
826b1cd
c8fcc1d
392689b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 | ||
richardguerre marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Check the version in
richardguerre marked this conversation as resolved.
Show resolved
Hide resolved
|
||
cache: "npm" | ||
registry-url: "https://npm.pkg.github.com" | ||
- name: Install dependencies | ||
run: | | ||
npm install --immutable --immutable-cache --check-cache | ||
shell: bash |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: CI/CD Checks | ||
richardguerre marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
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 | ||
richardguerre marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- 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 | ||
richardguerre marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 | ||
richardguerre marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
richardguerre marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 | ||
richardguerre marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- name: Test check | ||
run: npm run test -w apps/server | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The reason this check is in a loop is because vitest runs in watch mode in a development environment and in run mode when process.env.CI is truthy. Normally GitHub actions already insert
richardguerre marked this conversation as resolved.
Show resolved
Hide resolved
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this for? The GitHub actions seem to work fine without any "input".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. It's not needed. We'll remove it.