-
Notifications
You must be signed in to change notification settings - Fork 253
71 lines (70 loc) · 2.79 KB
/
ci_quick_checks_ubuntu.yaml
File metadata and controls
71 lines (70 loc) · 2.79 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
name: ci_quick_checks_ubuntu
concurrency:
group: ci_quick_checks_ubuntu-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches: ['**']
merge_group: {}
workflow_dispatch: {}
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
RUSTFLAGS: -D warnings
jobs:
ci_quick_checks_ubuntu:
name: ci_quick_checks_ubuntu
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ${{ github.repository_owner == 'nervosnetwork' && 'self-hosted-ci-ubuntu-20.04' || 'ubuntu-22.04' }}
steps:
- name: Free up disk space
if: github.repository_owner != 'nervosnetwork'
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
sudo docker image prune --all --force
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.92.0
components: rustfmt, clippy
- uses: actions/setup-go@v6
with:
go-version: '1.20'
- uses: actions/checkout@v4
- name: Cache cargo target
if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref != 'refs/heads/develop' && github.ref != 'refs/heads/master' && !startsWith(github.ref, 'refs/heads/rc/'))
uses: actions/cache@v4
with:
path: target
key: ci-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
ci-${{ runner.os }}-cargo-
- run: cargo fmt --all -- --check
- run: sudo apt-get update && sudo apt-get install libssl-dev pkg-config libclang-dev jq build-essential python3-pip -y
- run: pip3 install yq
- name: Run quick checks
run: |
echo tomlq path: $(which tomlq)
echo jq path: $(which jq)
tomlq --version
jq --version
make check-cargotoml
make check-whitespaces
make check-dirty-rpc-doc
make check-dirty-hashes-toml
devtools/ci/check-cyclic-dependencies.py
devtools/ci/check-relaxed.sh
shell: bash
- name: Disk usage summary
if: always() && (github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref != 'refs/heads/develop' && github.ref != 'refs/heads/master' && !startsWith(github.ref, 'refs/heads/rc/')))
run: |
echo "=== Disk Space Summary ==="
df -h
echo ""
echo "=== Target Directory Usage ==="
du -sh target/ 2>/dev/null || echo "target/ directory not found"
du -sh target/*/ 2>/dev/null || echo "No subdirectories in target/"