-
Notifications
You must be signed in to change notification settings - Fork 3
160 lines (129 loc) · 4.35 KB
/
ci.yaml
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: ci
on:
push:
branches:
- master
pull_request:
paths-ignore:
- "website/**"
jobs:
build:
name: tests
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: setup environment
uses: ./.github/actions/setup
- name: check
run: cargo check
- name: "build (bin: conductor)"
run: cargo build --bin conductor --release
- name: "build (bin: cloudflare_worker_wasm)"
working-directory: bin/cloudflare_worker
run: cargo install -q worker-build && worker-build
- name: test
run: cargo test
- name: install node
uses: actions/setup-node@v4
with:
node-version: "20"
- name: install napi deps
working-directory: libs/napi
run: yarn install
- name: build napi lib
working-directory: libs/napi
run: yarn build
graphql-over-http:
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: setup environment
uses: ./.github/actions/setup
- name: figure out versions
id: versions
working-directory: ./tests/graphql-over-http
run:
PNPM_VERSION=$(cat package.json | jq -r '.packageManager' | awk -F@ '{print $2}')
NODE_VERSION=$(cat package.json | jq -r '.engines.node' | awk -F= '{print $2}')
echo "pnpm=$PNPM_VERSION" >> $GITHUB_OUTPUT
echo "nodejs=$NODE_VERSION" >> $GITHUB_OUTPUT
- uses: the-guild-org/shared-config/setup@main
name: setup env
with:
nodeVersion: ${{ steps.versions.outputs.nodejs }}
packageManager: pnpm
packageManagerVersion: ${{ steps.versions.outputs.pnpm }}
workingDirectory: ./tests/graphql-over-http
- uses: JarvusInnovations/background-action@v1
with:
run: cargo run --bin conductor -- tests/graphql-over-http/config.yaml
wait-on: http-get://127.0.0.1:9000/graphql
tail: true
wait-for: 9m
log-output-if: failure
log-output: true
- uses: JarvusInnovations/background-action@v1
with:
run: cargo run --release
working-directory: tests/test-server
wait-on: http-get://127.0.0.1:4000
tail: true
wait-for: 9m
log-output-if: failure
log-output: true
- run: pnpm start
name: audit
working-directory: tests/graphql-over-http
env:
SERVER_URL: http://127.0.0.1:9000/graphql
config-json-schema:
runs-on: ubuntu-22.04
name: config-json-schema / integrity
steps:
- name: checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: setup environment
uses: ./.github/actions/setup
- name: generate config json schema
run: cargo run --bin generate-config-schema
- name: check diff
run: git diff --exit-code ./libs/config/conductor.schema.json
lint:
runs-on: ubuntu-22.04
name: rustfmt + clippy
steps:
- name: checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: setup environment
uses: ./.github/actions/setup
with:
components: rustfmt, clippy
- name: cargo fmt
run: cargo fmt --all -- --check
- uses: actions-rs/clippy-check@v1
name: cargo clippy
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
panic-free-audit:
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: setup environment
uses: ./.github/actions/setup
- name: install panic free analyzer
run: cargo install panic-analyzer@0.1.2
- name: run panic free analyzer
run: cargo panic-analyzer > ./panic-audit.md
env:
IGNORED_CRATES: e2e_tests,benches,server
IGNORED_FILES: ./plugins/jwt_auth/src/test.rs
- name: comment on pull request
uses: thollander/actions-comment-pull-request@v2
if: ${{ github.event_name == 'pull_request' }}
with:
filePath: ./panic-audit.md
comment_tag: rust-code-audit