-
Notifications
You must be signed in to change notification settings - Fork 9
99 lines (84 loc) · 2.62 KB
/
lint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: Lint
on:
push:
branches: [main]
paths:
- .github/workflows/*lint*.yml
- apps/**
- packages/**
- api/**
pull_request:
paths:
- .github/workflows/*lint*.yml
- apps/**
- packages/**
- api/**
merge_group:
branches: [main]
jobs:
lint:
name: Lint
runs-on: ubuntu-22.04
env:
PNPM_VERSION: "9.12.3"
services:
postgres:
image: postgres:12.15
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password1234
POSTGRES_DB: gctalent
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 3
steps:
- uses: actions/checkout@v4
- name: Add postgres extension pgcrypto # not included with postgres 12
run: docker run --rm --network ${{ job.container.network }} postgres:12.15 sh -c "PGPASSWORD=password1234 exec psql -h postgres -d gctalent -p 5432 -U postgres -t -c 'CREATE EXTENSION IF NOT EXISTS pgcrypto';"
- name: "Copy .env"
working-directory: "./apps/web"
run: |
cp .env.example .env
- uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: "./.nvmrc"
cache: pnpm
- name: "Install dependencies: workspace"
working-directory: ./
run: pnpm install
- name: "Setup: all workspaces"
working-directory: ./
run: pnpm run build:fresh
- name: "Run ESlint: all workspaces"
working-directory: ./
run: pnpm run lint
- name: "Run typescript linting: all workspaces"
# Allow tsc linting to happen even if js linting step raises errors.
if: always()
working-directory: ./
run: pnpm run tsc
- name: "Run prettier check: all workspaces"
# Allow tsc linting to happen even if js linting step raises errors.
if: always()
working-directory: ./
run: pnpm run prettier
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "8.3"
extensions: bcmath
- name: Install composer dependencies
working-directory: api
run: |
cp .env.example .env
composer install --no-interaction --prefer-dist --optimize-autoloader
- name: Run Pint
working-directory: api
run: vendor/bin/pint --test
- name: Run static analysis
working-directory: api
run: vendor/bin/phpstan analyse -c phpstan.neon