-
Notifications
You must be signed in to change notification settings - Fork 29
145 lines (126 loc) · 3.6 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
on:
push:
branches:
- master
pull_request:
branches:
- master
schedule: # https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onschedule
- cron: '0 0 * * 0' # at midnight of each sunday
name: CI
env:
CI_RUST_TOOLCHAIN: 1.66
jobs:
check:
name: Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.CI_RUST_TOOLCHAIN }}
override: true
- uses: actions-rs/cargo@v1
with:
command: check
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.CI_RUST_TOOLCHAIN }}
override: true
- uses: actions-rs/cargo@v1
with:
command: test
args: --all-features -- --test-threads=1
fmt:
name: Fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.CI_RUST_TOOLCHAIN }}
override: true
- run: rustup component add rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
clippy:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.CI_RUST_TOOLCHAIN }}
override: true
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --all-features -- -D warnings
e2e-test:
name: E2E Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ env.CI_RUST_TOOLCHAIN }}
override: true
- name: Check out mint code
uses: actions/checkout@v2
with:
repository: minio/mint
ref: ad883407695260e09ddaf309892d9f870e61bc29
path: ./mint
- name: Select test groups
run: |
pushd ./mint
enabled_test_groups=("mc" "s3cmd")
mkdir tmp_build
mkdir tmp_run_core
for test_group_name in ${enabled_test_groups[@]}
do
mv ./build/$test_group_name tmp_build/
mv ./run/core/$test_group_name tmp_run_core/
done
rm -rf build
rm -rf run/core
mv tmp_build build
mv tmp_run_core run/core
rm remove-packages.list
touch remove-packages.list
sed -i 's/mc.${MC_VERSION}/archive\/mc.${MC_VERSION}/' build/mc/install.sh
# lock mc version
sed -i 's/^MC_VERSION.*/MC_VERSION=RELEASE.2022-03-09T02-08-36Z/g' build/mc/install.sh
# delete tests for minio
cat >> build/mc/install.sh << EOF
sed -i '/^\s*test_rb\s*$/d' "\$test_run_dir/functional-tests.sh"
EOF
popd
- name: Build mint
run: |
pushd ./mint
docker build -t minio/mint . -f Dockerfile
popd
- name: Build s3-server
uses: actions-rs/cargo@v1
with:
command: build
args: --features binary --bins --release
- name: Run mint
run: |
mkdir data
RUST_LOG=info ./scripts/s3-server.sh data --release 1>/dev/null &
./scripts/mint.sh