-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (78 loc) · 2.39 KB
/
Copy pathci.yml
File metadata and controls
85 lines (78 loc) · 2.39 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
name: CI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-D warnings"
jobs:
fmt:
name: Rustfmt Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Check Formatting
run: cargo fmt --all -- --check
clippy:
name: Clippy Lint Check (Zero Warnings)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Run Clippy
run: cargo clippy --all-targets --all-features -- -D warnings
test:
name: Unit & Integration Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
# Pinned so jj CLI output stays stable for the adapter tests.
- name: Install Jujutsu
run: |
curl -sL -o /tmp/jj.tar.gz https://github.com/jj-vcs/jj/releases/download/v0.44.0/jj-v0.44.0-x86_64-unknown-linux-musl.tar.gz
mkdir -p /tmp/jj-install
tar -xzf /tmp/jj.tar.gz -C /tmp/jj-install
sudo mv /tmp/jj-install/jj /usr/local/bin/jj
jj --version
- name: Configure jj identity
run: |
jj config set --user user.name "Oot CI"
jj config set --user user.email "oot-ci@example.com"
- name: Run Tests
run: cargo test --all-targets --all-features --verbose
build:
name: Release Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- name: Build Release Binary
run: cargo build --release --verbose
oot:
name: Oot Adjudication (dogfood)
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@v4
with:
# Full history so git merge-base between the PR branch and main resolves.
fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable
- name: Build Oot
run: cargo build --release
- name: Adjudicate PR against main
run: |
./target/release/oot adjudicate \
--change "${{ github.head_ref }}" \
--base-ref origin/main \
--head-ref HEAD \
--repo . \
--visibility visibility.toml