-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (47 loc) · 1.66 KB
/
build-test-heaphook.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
name: build test heaphook
on:
pull_request:
types:
- labeled
jobs:
build-and-test-heaphook:
if: ${{ github.event.label.name == 'run-build-test' }}
runs-on: ubuntu-22.04
steps:
- name: Set PR fetch depth
run: echo "PR_FETCH_DEPTH=$(( ${{ github.event.pull_request.commits }} + 1 ))" >> "${GITHUB_ENV}"
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: ${{ env.PR_FETCH_DEPTH }}
- name: Check for .rs file changes
id: check_changes_rust
run: |
if git diff --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} | grep '\.rs$'; then
echo ".rs files changed"
echo "rust_changed=true" >> $GITHUB_OUTPUT
else
echo "No .rs files changed"
echo "rust_changed=false" >> $GITHUB_OUTPUT
fi
- name: Setup Rust environment
if: steps.check_changes_rust.outputs.rust_changed == 'true'
run: |
rustup toolchain install nightly-2024-08-13
rustup default nightly-2024-08-13
rustup component add clippy rustfmt
- name: Run rustfmt on agnocast_heaphook
if: steps.check_changes_rust.outputs.rust_changed == 'true'
run: |
cd agnocast_heaphook
cargo fmt && git diff --exit-code
- name: Run clippy on agnocast_heaphook
if: steps.check_changes_rust.outputs.rust_changed == 'true'
run: |
cd agnocast_heaphook
cargo clippy -- --deny warnings
- name: Build agnocast_heaphook
if: steps.check_changes_rust.outputs.rust_changed == 'true'
run: |
cd agnocast_heaphook
cargo build