Skip to content

Commit 1c838fd

Browse files
committed
add basic CI flow
1 parent cc66d79 commit 1c838fd

File tree

3 files changed

+140
-0
lines changed

3 files changed

+140
-0
lines changed

.github/CODEOWNERS

Whitespace-only changes.

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"

.github/workflows/ci.yml

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
name: CI
2+
3+
permissions: {}
4+
5+
on:
6+
workflow_dispatch:
7+
pull_request:
8+
push:
9+
branches:
10+
- master
11+
12+
jobs:
13+
build:
14+
name: build +${{ matrix.toolchain }} ${{ matrix.flags }}
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 10
17+
permissions:
18+
contents: read
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
toolchain: [stable, nightly]
23+
flags:
24+
- ""
25+
- --via-ir
26+
- --use solc:0.8.17 --via-ir
27+
- --use solc:0.8.17
28+
- --use solc:0.8.0
29+
- --use solc:0.7.6
30+
- --use solc:0.7.0
31+
- --use solc:0.6.2
32+
- --use solc:0.6.12
33+
steps:
34+
- uses: actions/checkout@v5
35+
with:
36+
persist-credentials: false
37+
- uses: foundry-rs/foundry-toolchain@v1
38+
- run: forge --version
39+
- run: |
40+
case "${{ matrix.flags }}" in
41+
*)
42+
forge build --skip test --deny-warnings ${{ matrix.flags }}
43+
;;
44+
esac
45+
# via-ir compilation time checks.
46+
- if: contains(matrix.flags, '--via-ir')
47+
run: forge build --skip test --deny-warnings ${{ matrix.flags }} --contracts 'test/compilation/*'
48+
49+
test:
50+
runs-on: ubuntu-latest
51+
timeout-minutes: 10
52+
permissions:
53+
contents: read
54+
strategy:
55+
fail-fast: false
56+
matrix:
57+
toolchain: [stable, nightly]
58+
steps:
59+
- uses: actions/checkout@v5
60+
with:
61+
persist-credentials: false
62+
- uses: foundry-rs/foundry-toolchain@v1
63+
with:
64+
version: ${{ matrix.toolchain }}
65+
- run: forge --version
66+
- run: forge test -vvv
67+
68+
fmt:
69+
runs-on: ubuntu-latest
70+
timeout-minutes: 10
71+
permissions:
72+
contents: read
73+
steps:
74+
- uses: actions/checkout@v5
75+
with:
76+
persist-credentials: false
77+
- uses: foundry-rs/foundry-toolchain@v1
78+
- run: forge --version
79+
- run: forge fmt --check
80+
81+
typos:
82+
runs-on: ubuntu-latest
83+
timeout-minutes: 10
84+
permissions:
85+
contents: read
86+
steps:
87+
- uses: actions/checkout@v5
88+
with:
89+
persist-credentials: false
90+
- uses: crate-ci/typos@80c8a4945eec0f6d464eaf9e65ed98ef085283d1 # v1
91+
92+
codeql:
93+
name: Analyze (${{ matrix.language }})
94+
runs-on: ubuntu-latest
95+
permissions:
96+
security-events: write
97+
actions: read
98+
contents: read
99+
strategy:
100+
fail-fast: false
101+
matrix:
102+
include:
103+
- language: actions
104+
build-mode: none
105+
steps:
106+
- name: Checkout repository
107+
uses: actions/checkout@v5
108+
with:
109+
persist-credentials: false
110+
- name: Initialize CodeQL
111+
uses: github/codeql-action/init@v4
112+
with:
113+
languages: ${{ matrix.language }}
114+
build-mode: ${{ matrix.build-mode }}
115+
- name: Perform CodeQL Analysis
116+
uses: github/codeql-action/analyze@v4
117+
with:
118+
category: "/language:${{matrix.language}}"
119+
120+
ci-success:
121+
runs-on: ubuntu-latest
122+
if: always()
123+
needs:
124+
- build
125+
- test
126+
- fmt
127+
- typos
128+
- codeql
129+
timeout-minutes: 10
130+
steps:
131+
- name: Decide whether the needed jobs succeeded or failed
132+
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # release/v1
133+
with:
134+
jobs: ${{ toJSON(needs) }}

0 commit comments

Comments
 (0)