Skip to content

Commit 8bb2a20

Browse files
authored
feat(ci): basic CI (#6)
1 parent 57de1a7 commit 8bb2a20

File tree

5 files changed

+191
-1
lines changed

5 files changed

+191
-1
lines changed

.github/workflows/misc-ci.yaml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Misc CI (Language Agnostic)
2+
on:
3+
pull_request:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
- prod
9+
tags:
10+
- '**'
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
fmt_toml:
17+
name: TOML Format (Taplo)
18+
runs-on: ubuntu-24.04
19+
steps:
20+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # pin@v6.0.1
21+
with:
22+
token: ${{ secrets.GIT_HUB_TOKEN }}
23+
- uses: cachix/install-nix-action@0b0e072294b088b73964f1d72dfdac0951439dbd # pin@v31.8.4
24+
with:
25+
github_access_token: ${{ secrets.GIT_HUB_TOKEN }}
26+
- uses: cachix/cachix-action@ad2ddac53f961de1989924296a1f236fcfbaa4fc # pin@v15
27+
continue-on-error: true
28+
with:
29+
name: worldcoin
30+
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
31+
- name: Print environment
32+
run: |
33+
uname -a
34+
nix develop -c env
35+
36+
- name: Check TOML formatting
37+
run: |
38+
nix develop -c \
39+
taplo format --check
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Pull-Request Compliance
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
- reopened
10+
11+
permissions:
12+
pull-requests: read
13+
14+
jobs:
15+
check-pr-title:
16+
name: Check PR title
17+
runs-on: ubuntu-24.04
18+
steps:
19+
- uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # pin@v5.5.3
20+
env:
21+
GITHUB_TOKEN: ${{ github.token }}
22+
23+
require-pr-description:
24+
name: Require PR Description
25+
runs-on: ubuntu-24.04
26+
steps:
27+
- name: Fail if description is empty
28+
if: ${{ github.event.pull_request.body == '' }}
29+
run: |
30+
echo "❌ A pull request description is required. Please update the PR body."
31+
exit 1
32+
33+
- name: Fail if description is unchanged template
34+
if: contains(github.event.pull_request.body, '<!-- Describe your changes here -->')
35+
run: |
36+
echo "❌ Please replace the PR template placeholder with a real description."
37+
exit 1

.github/workflows/rust-ci.yaml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: Rust CI
2+
on:
3+
pull_request:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
- prod
9+
tags:
10+
- '**'
11+
12+
permissions:
13+
read: true
14+
15+
jobs:
16+
fmt:
17+
name: Format
18+
runs-on: ubuntu-24.04
19+
steps:
20+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # pin@v6.0.1
21+
with:
22+
token: ${{ secrets.GIT_HUB_TOKEN }}
23+
- uses: cachix/install-nix-action@0b0e072294b088b73964f1d72dfdac0951439dbd # pin@v31.8.4
24+
with:
25+
github_access_token: ${{ secrets.GIT_HUB_TOKEN }}
26+
- uses: cachix/cachix-action@ad2ddac53f961de1989924296a1f236fcfbaa4fc # pin@v15
27+
continue-on-error: true
28+
with:
29+
name: worldcoin
30+
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
31+
- name: Print environment
32+
run: |
33+
uname -a
34+
nix develop -c env
35+
36+
- name: Check Rust formatting
37+
run: cargo fmt --check --all
38+
39+
clippy:
40+
name: Clippy
41+
runs-on: ubuntu-24.04
42+
steps:
43+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # pin@v6.0.1
44+
with:
45+
token: ${{ secrets.GIT_HUB_TOKEN }}
46+
- uses: cachix/install-nix-action@0b0e072294b088b73964f1d72dfdac0951439dbd # pin@v31.8.4
47+
with:
48+
github_access_token: ${{ secrets.GIT_HUB_TOKEN }}
49+
- uses: cachix/cachix-action@ad2ddac53f961de1989924296a1f236fcfbaa4fc # pin@v15
50+
continue-on-error: true
51+
with:
52+
name: worldcoin
53+
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
54+
- name: Authorize private git repos
55+
run: git config --global url."https://${{ secrets.ORB_GIT_HUB_TOKEN }}@github.com".insteadOf https://github.com
56+
- name: Cache cargo dependencies
57+
uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # pin@v2.8.0
58+
with:
59+
key: custom-${{ hashFiles('**/*.nix', 'flake.lock') }}
60+
- name: Print environment
61+
run: |
62+
uname -a
63+
nix develop -c env
64+
65+
- name: Clippy lints
66+
run: |
67+
nix develop -c \
68+
cargo clippy --all --all-features --all-targets --no-deps -- -D warnings
69+
70+
cargo-deny:
71+
name: Cargo Deny
72+
runs-on: ubuntu-24.04
73+
steps:
74+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # pin@v6.0.1
75+
with:
76+
token: ${{ secrets.GIT_HUB_TOKEN }}
77+
- uses: cachix/install-nix-action@0b0e072294b088b73964f1d72dfdac0951439dbd # pin@v31.8.4
78+
with:
79+
github_access_token: ${{ secrets.GIT_HUB_TOKEN }}
80+
- uses: cachix/cachix-action@ad2ddac53f961de1989924296a1f236fcfbaa4fc # pin@v15
81+
continue-on-error: true
82+
with:
83+
name: worldcoin
84+
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
85+
- name: Authorize private git repos
86+
run: git config --global url."https://${{ secrets.GIT_HUB_TOKEN }}@github.com".insteadOf https://github.com
87+
- name: Print environment
88+
run: |
89+
uname -a
90+
nix develop -c env
91+
92+
- name: Check licenses
93+
run: |
94+
nix develop -c \
95+
cargo deny check licenses
96+
97+
- name: Check security advisories
98+
run: |
99+
nix develop -c \
100+
cargo deny check advisories

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ license = "MIT OR (Apache-2.0 WITH LLVM-exception)"
1111
repository = "https://github.com/worldcoin/orb-rustzone-ci"
1212

1313
[workspace.dependencies.orb-x-optee]
14-
git = "https://github.com/worldcoin/orb-software"
1514
branch = "main"
15+
git = "https://github.com/worldcoin/orb-software"

taplo.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
exclude = ["**/target/**/*", ".direnv/**/*"]
2+
3+
[formatting]
4+
align_comments = false
5+
column_width = 88
6+
indent_string = " "
7+
reoder_arrays = true
8+
reorder_keys = true
9+
trailing_newline = true
10+
11+
[[rule]]
12+
keys = ["package", "project"]
13+
[rule.formatting]
14+
reorder_keys = false

0 commit comments

Comments
 (0)