-
Notifications
You must be signed in to change notification settings - Fork 24
167 lines (162 loc) · 5.56 KB
/
audits.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
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
161
162
163
164
165
166
167
name: Audits
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
javascript:
name: JavaScript
runs-on: ubuntu-latest
strategy:
matrix:
workspace:
- apollo-server
- express-graphql
- graph-client
- graphql-helix
- graphql-yoga
- mercurius
env:
PORT: 4000
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up node
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: yarn
- name: Install
run: yarn install --immutable
- name: Start
run: yarn workspace ${{ matrix.workspace }} start &
- name: Audit
run: yarn tsx scripts/audit-implementation.ts implementations/${{ matrix.workspace }}
- name: Summary
run: cat implementations/${{ matrix.workspace }}/README.md >> $GITHUB_STEP_SUMMARY
- name: Upload audit report
uses: actions/upload-artifact@v3
with:
name: audit-reports
# > If multiple paths are provided as input, the least common ancestor of all the search paths will be used as the root directory of the artifact.
# https://github.com/actions/upload-artifact#upload-using-multiple-paths-and-exclusions
#
# Because of this, we include the root README.md to maintain the paths during artifact downloads
path: |
README.md
implementations/${{ matrix.workspace }}/README.md
implementations/${{ matrix.workspace }}/report.json
docker:
name: Docker
runs-on: ubuntu-latest
strategy:
matrix:
workspace:
- deno
- hotchocolate
- lighthouse
- postgraphile
# TODO: speed up build process
# - pioneer
env:
PORT: 4000
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up docker buildx
uses: docker/setup-buildx-action@v2
- name: Set up node
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: yarn
- name: Install
run: yarn install --immutable
- name: Bake
uses: docker/bake-action@v2
with:
workdir: implementations/${{ matrix.workspace }}
load: true # load image into docker, otherwise `docker compose up` will rebuild
set: |
*.cache-from=type=gha
*.cache-to=type=gha,mode=max
- name: Start
run: yarn workspace ${{ matrix.workspace }} start --detach --wait
- name: Audit
run: yarn tsx scripts/audit-implementation.ts implementations/${{ matrix.workspace }}
- name: Summary
run: cat implementations/${{ matrix.workspace }}/README.md >> $GITHUB_STEP_SUMMARY
- name: Upload audit report
uses: actions/upload-artifact@v3
with:
name: audit-reports
# > If multiple paths are provided as input, the least common ancestor of all the search paths will be used as the root directory of the artifact.
# https://github.com/actions/upload-artifact#upload-using-multiple-paths-and-exclusions
#
# Because of this, we include the root README.md to maintain the paths during artifact downloads
path: |
README.md
implementations/${{ matrix.workspace }}/README.md
implementations/${{ matrix.workspace }}/report.json
url:
name: URL
runs-on: ubuntu-latest
strategy:
matrix:
workspace:
- name: thegraph
url: https://api.thegraph.com/subgraphs/name/sushiswap/exchange/graphql
env:
URL: ${{ matrix.workspace.url }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up node
uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: yarn
- name: Install
run: yarn install --immutable
- name: Audit
run: yarn tsx scripts/audit-implementation.ts implementations/${{ matrix.workspace.name }}
- name: Summary
run: cat implementations/${{ matrix.workspace.name }}/README.md >> $GITHUB_STEP_SUMMARY
- name: Upload audit report
uses: actions/upload-artifact@v3
with:
name: audit-reports
# > If multiple paths are provided as input, the least common ancestor of all the search paths will be used as the root directory of the artifact.
# https://github.com/actions/upload-artifact#upload-using-multiple-paths-and-exclusions
#
# Because of this, we include the root README.md to maintain the paths during artifact downloads
path: |
README.md
implementations/${{ matrix.workspace.name }}/README.md
implementations/${{ matrix.workspace.name }}/report.json
report:
permissions:
contents: write
pull-requests: write
name: Report
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
needs: [javascript, docker, url]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download audit reports
uses: actions/download-artifact@v3
with:
name: audit-reports
- name: Render servers table
run: node scripts/render-servers-table.mjs
- name: Create Pull Request
uses: peter-evans/create-pull-request@v7
with:
title: Audit Report
body: New audit report available.
commit-message: 'docs(implementations): audit report'