-
Notifications
You must be signed in to change notification settings - Fork 21
105 lines (92 loc) · 2.91 KB
/
ci.yml
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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
name: Continuous integration
on:
push:
branches: [ "main" ]
paths-ignore:
- "docs/**"
- "**/*.md"
- "**/*.yaml"
pull_request:
branches: [ "main" ]
paths-ignore:
- "docs/**"
- "**/*.md"
- "**/*.yaml"
env:
CARGO_TERM_COLOR: always
RUST_TOOLCHAIN: 1.68.0
jobs:
build:
name: Continuous integration
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions-rs/[email protected]
with:
profile: minimal
toolchain: ${{ env.RUST_TOOLCHAIN }}
override: true
- name: Install dependences
id: install_deps
run: make install_deps
- name: Copy cache
run: |
mkdir -p /data/action/_work/sealfs/sealfs/target
if [ -d /data/backup/debug ]; then
mv /data/backup/debug /data/action/_work/sealfs/sealfs/target
fi
- name: Build
id: make-build
run: |
make build
# make build features=mem-db
continue-on-error: true
- name: Check
id: cargo-check
run: |
cargo check --features=disk-db
# cargo check --features=mem-db
continue-on-error: true
- name: Test Suite
id: make-test
run: |
sudo rm -rf /tmp/test*
make test
./test_io500.sh /data
# make test features=mem-db
continue-on-error: true
- name: Clippy
id: cargo-clippy
run: |
rustup component add clippy
cargo clippy --features=disk-db -- -D warnings
# cargo clippy --features=mem-db -- -D warnings
continue-on-error: true
- name: Rustfmt
id: cargo-fmt
run: |
rustup component add rustfmt
cargo fmt --all -- --check
continue-on-error: true
- if: always()
name: Backup Temporary
run: |
if [ -d /data/action/_work/sealfs/sealfs/target/debug ]; then
if [ -d /data/backup/debug ]; then
rm -rf /data/backup/debug
fi
mv /data/action/_work/sealfs/sealfs/target/debug /data/backup
fi
- if: ${{ steps.install_deps.outcome == 'success' }}
name: Summary
run: |
echo "Build: ${{ steps.make-build.outcome }}"
echo "Check: ${{ steps.cargo-check.outcome }}"
echo "Test: ${{ steps.make-test.outcome }}"
echo "Clippy: ${{ steps.cargo-clippy.outcome }}"
echo "Rustfmt: ${{ steps.cargo-fmt.outcome }}"
if [ "${{ steps.make-build.outcome }}" != "success" ] || [ "${{ steps.cargo-check.outcome }}" != "success" ] || [ "${{ steps.make-test.outcome }}" != "success" ] || [ "${{ steps.cargo-clippy.outcome }}" != "success" ] || [ "${{ steps.cargo-fmt.outcome }}" != "success" ]; then
exit 1
fi