-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: switch from jenkins to github actions
Jenkins has become troublesome to maintain and makes it harder for users to see and test output without adding new users. We could probably spend some time improving that, but the current Jenkins is also setup on systems managed by the sponsoring company so it makes sense to move away from that at least. In order to run the CI tests we need a relatively powerful CI system so we are making use of the ubuntu-latest-16-cores runners. The tests seem to run slower than on Jenkins. Part of it may be explained because the dependencies are not pre-cache. Signed-off-by: Tiago Castro <[email protected]>
- Loading branch information
1 parent
17488f4
commit 82dc1bb
Showing
33 changed files
with
362 additions
and
102 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
name: BDD CI | ||
on: | ||
workflow_call: | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
CARGO_INCREMENTAL: 0 | ||
|
||
jobs: | ||
bdd-tests: | ||
runs-on: ubuntu-latest-16-cores | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
submodules: 'recursive' | ||
- uses: DeterminateSystems/nix-installer-action@v14 | ||
- uses: DeterminateSystems/magic-nix-cache-action@v8 | ||
- name: Pre-populate nix-shell | ||
run: | | ||
export NIX_PATH=nixpkgs=$(jq '.nixpkgs.url' nix/sources.json -r) | ||
echo "NIX_PATH=$NIX_PATH" >> $GITHUB_ENV | ||
nix-shell --run "echo" shell.nix | ||
- name: Handle Rust dependencies caching | ||
uses: Swatinem/rust-cache@v2 | ||
- name: Build binaries | ||
run: nix-shell --run "cargo build --bins --features=io-engine-testing" | ||
- name: Setup Test Pre-Requisites | ||
run: | | ||
sudo sysctl -w vm.nr_hugepages=2560 | ||
sudo apt-get install linux-modules-extra-$(uname -r) | ||
for module in nvme_tcp nbd nvme_rdma; do | ||
sudo modprobe $module | ||
done | ||
# for the coredump check | ||
sudo apt-get install gdb | ||
- name: Setup VENV | ||
run: nix-shell --run "./test/python/setup.sh" | ||
- name: Run BDD Tests | ||
run: | | ||
echo "TEST_START_DATE=$(date +"%Y-%m-%d %H:%M:%S")" >> $GITHUB_ENV | ||
nix-shell --run "./scripts/pytest-tests.sh" | ||
- name: Test Report | ||
if: always() | ||
uses: pmeier/pytest-results-action@main | ||
with: | ||
path: test/python/reports/**/xunit-report.xml | ||
summary: true | ||
display-options: a | ||
fail-on-empty: true | ||
title: Test results | ||
- name: Cleanup | ||
if: always() | ||
run: nix-shell --run "./scripts/pytest-tests.sh --clean-all-exit" | ||
- name: Check Coredumps | ||
run: sudo ./scripts/check-coredumps.sh --since "${TEST_START_DATE}" | ||
# debugging | ||
# - name: Setup tmate session | ||
# if: ${{ failure() }} | ||
# timeout-minutes: 240 | ||
# uses: mxschmitt/action-tmate@v3 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: ImageBuild CI | ||
on: | ||
workflow_call: | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
CARGO_INCREMENTAL: 0 | ||
|
||
jobs: | ||
image-build-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: 'recursive' | ||
- uses: DeterminateSystems/nix-installer-action@v14 | ||
- uses: DeterminateSystems/magic-nix-cache-action@v8 | ||
- name: Test building the release images | ||
run: ./scripts/release.sh --skip-publish --build-bins |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
name: Image Push | ||
on: | ||
push: | ||
branches: | ||
- develop | ||
- 'release/**' | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+**' | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
CARGO_INCREMENTAL: 0 | ||
|
||
jobs: | ||
image-build-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: 'recursive' | ||
- uses: DeterminateSystems/nix-installer-action@v14 | ||
- uses: DeterminateSystems/magic-nix-cache-action@v8 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ vars.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Test building the release images | ||
run: ./scripts/release.sh |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Unit/Int CI | ||
on: | ||
workflow_call: | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
CARGO_INCREMENTAL: 0 | ||
|
||
jobs: | ||
code-linter: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: 'recursive' | ||
- uses: DeterminateSystems/nix-installer-action@v14 | ||
- uses: DeterminateSystems/magic-nix-cache-action@v8 | ||
- name: Pre-populate nix-shell | ||
run: | | ||
export NIX_PATH=nixpkgs=$(jq '.nixpkgs.url' nix/sources.json -r) | ||
echo "NIX_PATH=$NIX_PATH" >> $GITHUB_ENV | ||
nix-shell --run "echo" shell.nix | ||
- name: Handle Rust dependencies caching | ||
uses: Swatinem/rust-cache@v2 | ||
- name: Lint rust code | ||
run: | | ||
nix-shell --run "FMT_OPTS=--check ./scripts/rust-style.sh" | ||
nix-shell --run "./scripts/rust-linter.sh" | ||
- name: Lint JS code | ||
run: nix-shell --run "./scripts/js-check.sh" | ||
- name: Lint Nix code | ||
run: nix-shell --run "nixpkgs-fmt --check ." |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Nightly CI | ||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
ci: | ||
uses: ./.github/workflows/pr-ci.yml | ||
nightly-ci: | ||
if: ${{ success() }} | ||
needs: | ||
- ci | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: CI succeeded | ||
run: exit 0 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Bors CI | ||
on: | ||
push: | ||
branches: | ||
- staging | ||
- trying | ||
|
||
jobs: | ||
lint-ci: | ||
uses: ./.github/workflows/lint.yml | ||
int-ci: | ||
uses: ./.github/workflows/unit-int.yml | ||
bdd-ci: | ||
uses: ./.github/workflows/bdd.yml | ||
image-ci: | ||
uses: ./.github/workflows/image-pr.yml | ||
bors-ci: | ||
if: ${{ success() }} | ||
needs: | ||
- lint-ci | ||
- int-ci | ||
- bdd-ci | ||
- image-ci | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: CI succeeded | ||
run: exit 0 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Integration CI | ||
on: | ||
workflow_call: | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
CARGO_INCREMENTAL: 0 | ||
|
||
jobs: | ||
int-tests: | ||
runs-on: ubuntu-latest-16-cores | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
submodules: 'recursive' | ||
- uses: DeterminateSystems/nix-installer-action@v14 | ||
- uses: DeterminateSystems/magic-nix-cache-action@v8 | ||
- name: Pre-populate nix-shell | ||
run: | | ||
export NIX_PATH=nixpkgs=$(jq '.nixpkgs.url' nix/sources.json -r) | ||
echo "NIX_PATH=$NIX_PATH" >> $GITHUB_ENV | ||
nix-shell --run "echo" shell.nix | ||
- name: Handle Rust dependencies caching | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
save-if: ${{ startsWith(github.ref_name, 'release/') || github.ref_name == 'develop' }} | ||
- name: Build binaries | ||
run: nix-shell --run "cargo build --bins --features=io-engine-testing" | ||
- name: Setup Test Pre-Requisites | ||
run: | | ||
sudo sysctl -w vm.nr_hugepages=3584 | ||
sudo apt-get install linux-modules-extra-$(uname -r) | ||
for module in nvme_tcp nbd nvme_rdma; do | ||
sudo modprobe $module | ||
done | ||
sudo apt-get install gdb | ||
- name: Run Rust Tests | ||
run: | | ||
echo "TEST_START_DATE=$(date +"%Y-%m-%d %H:%M:%S")" >> $GITHUB_ENV | ||
nix-shell --run "./scripts/cargo-test.sh" | ||
- name: Cleanup | ||
if: always() | ||
run: nix-shell --run "./scripts/clean-cargo-tests.sh" | ||
- name: Check Coredumps | ||
run: sudo ./scripts/check-coredumps.sh --since "${TEST_START_DATE}" | ||
- name: Run JS Grpc Tests | ||
run: | | ||
echo "TEST_START_DATE=$(date +"%Y-%m-%d %H:%M:%S")" >> $GITHUB_ENV | ||
nix-shell --run "./scripts/grpc-test.sh" | ||
mkdir js-reports | ||
for file in *-xunit-report.xml; do | ||
echo "<testsuites>" > "js-reports/$file" | ||
cat $file >> "js-reports/$file" | ||
echo "</testsuites>" >> "js-reports/$file" | ||
done | ||
- name: Test Report | ||
if: always() | ||
uses: pmeier/pytest-results-action@main | ||
with: | ||
path: 'js-reports/*-xunit-report.xml' | ||
summary: true | ||
display-options: a | ||
fail-on-empty: true | ||
title: Test results | ||
- name: Cleanup | ||
if: always() | ||
run: nix-shell --run "./scripts/clean-cargo-tests.sh" | ||
- name: Check Coredumps | ||
run: sudo ./scripts/check-coredumps.sh --since "${TEST_START_DATE}" | ||
# debugging | ||
# - name: Setup tmate session | ||
# if: ${{ failure() }} | ||
# timeout-minutes: 240 | ||
# uses: mxschmitt/action-tmate@v3 |
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
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
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
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
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
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.