CI #356
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |