Repository navigation
115 lines (93 loc) · 3.04 KB
/
Copy pathci.yml
File metadata and controls
115 lines (93 loc) · 3.04 KB
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: CI
on:
pull_request:
branches: [main]
merge_group:
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
defaults:
run:
shell: bash
jobs:
gitleaks:
name: Secret scan
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- name: Check out repository history
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
fetch-depth: 0
persist-credentials: false
- name: Scan history for secrets
run: |
docker run --rm \
-v "$GITHUB_WORKSPACE:/repo:ro" \
ghcr.io/gitleaks/gitleaks:v8.29.0 \
git /repo --config /repo/.gitleaks.toml --redact
static-analysis:
name: Static analysis
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up pnpm
uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
- name: Set up Node.js
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: package.json
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Validate contract catalog
run: pnpm run check
- name: Check types
run: pnpm run tsc
- name: Lint
run: pnpm run lint
- name: Check unused code and dependencies
run: pnpm run knip
build:
name: Build
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up pnpm
uses: pnpm/action-setup@ea17c68df8912ef543352723c149a84f56e3d413 # v6.1.0
- name: Set up Node.js
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version-file: package.json
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build package
run: pnpm run build
- name: Build schema publisher image
run: make image IMAGE=monadiam/shared-schemas:ci VCS_REF="$GITHUB_SHA"
- name: Check schema publisher image
run: docker run --rm --read-only --network none monadiam/shared-schemas:ci scripts/check.sh
ci:
name: CI passed
if: ${{ always() }}
needs: [gitleaks, static-analysis, build]
runs-on: ubuntu-24.04
timeout-minutes: 5
permissions: {}
steps:
- name: Require every check to pass
env:
PASSED: ${{ needs.gitleaks.result == 'success' && needs.static-analysis.result == 'success' && needs.build.result == 'success' }}
run: test "$PASSED" = true