-
Notifications
You must be signed in to change notification settings - Fork 1
54 lines (47 loc) · 1.59 KB
/
ci.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
name: CI
on:
pull_request:
push:
branches: ['main', 'staging']
workflow_dispatch:
env:
NODE_OPTIONS: '--max_old_space_size=4096'
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true
jobs:
ci:
runs-on: ubuntu-latest
environment: ${{ github.ref == 'refs/heads/staging' && 'staging' || 'preview' }}
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
name: Checkout [Pull Request]
if: ${{ github.event_name == 'pull_request' }}
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- uses: actions/checkout@v3
name: Checkout [Default Branch]
if: ${{ github.event_name != 'pull_request' }}
with:
fetch-depth: 0
- name: Derive appropriate SHAs for base and head for nx affected commands
id: nx
uses: nrwl/nx-set-shas@v3
with:
main-branch-name: staging
- name: Set up environment and cache dependencies
uses: sebpalluel/ci/.github/actions/setup-environment@latest
- name: Setup docker tests containers and run check 'format'
run: |
set -e
pnpm docker:test &
pnpm nx format:check --verbose &
wait -n
# # Prefered to run sequentially because otherwise slower with vercel cache hanging
# pnpm nx affected:lint --parallel --maxParallel=3 && pnpm nx affected:test --parallel --maxParallel=3 &
# wait -n
- name: Run integration tests
run: |
pnpm affected:test-integration