-
Notifications
You must be signed in to change notification settings - Fork 355
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- standarized all CI to use Ubuntu 22 - refactored the justfile - moved the rust integration test to e2e - moved the oci validation go version to e2e - change the file filter action to `tj-actions/changed-files` - refactored the dependencies installation to `just prepare` recipe Signed-off-by: yihuaf <[email protected]>
- Loading branch information
Showing
5 changed files
with
159 additions
and
97 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,10 +16,10 @@ jobs: | |
- uses: actions/checkout@v3 | ||
- name: Setup Rust toolchain and cache | ||
uses: actions-rust-lang/[email protected] | ||
- name: Install requirements | ||
run: sudo ./.github/scripts/dependency.sh | ||
- name: Install just | ||
uses: taiki-e/install-action@just | ||
- name: Install requirements | ||
run: just prepare | ||
- name: Build youki | ||
run: just youki-release | ||
- name: Upload youki binary | ||
|
@@ -77,3 +77,52 @@ jobs: | |
# # - name: Debug | ||
# # if: ${{ always() }} | ||
# # uses: mxschmitt/action-tmate@v3 | ||
|
||
oci-validation-go: | ||
runs-on: ubuntu-22.04 | ||
needs: [youki-build] | ||
timeout-minutes: 15 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Setup Rust toolchain and cache | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
- name: Install just | ||
uses: taiki-e/install-action@just | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: '1.19.9' | ||
cache: true | ||
cache-dependency-path: tests/oci-runtime-tests/src/github.com/opencontainers/runtime-tools/go.sum | ||
- name: Download youki binary | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: youki | ||
- name: Add the permission to run | ||
run: chmod +x ./youki | ||
- name: Run integration tests | ||
run: just oci-tests | ||
|
||
oci-validation-rust: | ||
runs-on: ubuntu-22.04 | ||
needs: [youki-build] | ||
timeout-minutes: 15 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Setup Rust toolchain and cache | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
- name: Install just | ||
uses: taiki-e/install-action@just | ||
- name: Download youki binary | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: youki | ||
- name: Add the permission to run | ||
run: chmod +x ./youki | ||
- name: Build | ||
run: just runtimetest rust-oci-tests-bin | ||
- name: Validate tests on youki | ||
run: just rust-oci-tests |
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 |
---|---|---|
|
@@ -9,39 +9,43 @@ on: | |
|
||
jobs: | ||
changes: | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 15 | ||
outputs: | ||
dirs: ${{ steps.filter.outputs.changes }} | ||
any_modified: ${{ steps.filter.outputs.any_modified }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dorny/paths-filter@v2 | ||
- uses: tj-actions/changed-files@v36 | ||
id: filter | ||
with: | ||
filters: | | ||
./integration_test: | ||
- './tests/rust-integration-tests/**' | ||
files: | | ||
integration_test/tests/rust-integration-tests/** | ||
files_ignore: | | ||
**.md | ||
- name: List all changed files | ||
run: | | ||
for file in ${{ steps.filter.outputs.all_modified_files }}; do | ||
echo "$file was changed" | ||
done | ||
validate: | ||
needs: [changes] | ||
if: ${{ !contains(needs.changes.outputs.dirs, '[]') }} | ||
runs-on: ubuntu-20.04 | ||
if: needs.changes.outputs.any_modified == 'true' | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 30 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Rust toolchain and cache | ||
uses: actions-rust-lang/[email protected] | ||
- name: Install requirements | ||
run: sudo ./.github/scripts/dependency.sh | ||
- name: Install just | ||
uses: taiki-e/install-action@just | ||
- name: Install requirements | ||
run: just prepare | ||
- name: Install runc 1.1.0 | ||
run: | | ||
wget -q https://github.com/opencontainers/runc/releases/download/v1.1.0/runc.amd64 | ||
sudo mv runc.amd64 /usr/bin/runc | ||
sudo chmod 755 /usr/bin/runc | ||
- name: Build | ||
run: just youki-release runtimetest rust-oci-tests-bin | ||
run: just runtimetest rust-oci-tests-bin | ||
- name: Validate tests on runc | ||
run: just validate-rust-oci-runc | ||
- name: Validate tests on youki | ||
run: just rust-oci-tests |
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 |
---|---|---|
|
@@ -9,70 +9,64 @@ on: | |
|
||
jobs: | ||
changes: | ||
runs-on: ubuntu-20.04 | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 15 | ||
outputs: | ||
dirs: ${{ steps.filter.outputs.changes }} | ||
any_modified: ${{ steps.filter.outputs.any_modified }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: dorny/paths-filter@v2 | ||
- uses: tj-actions/changed-files@v36 | ||
id: filter | ||
with: | ||
filters: | | ||
crates/youki: | ||
- 'crates/youki/**' | ||
crates/libcontainer: | ||
- 'crates/libcontainer/**' | ||
crates/libcgroups: | ||
- 'crates/libcgroups/**' | ||
tests/rust-integration-tests/runtimetest: | ||
- './tests/rust-integration-tests/runtimetest/**' | ||
tests/rust-integration-tests/integration_test: | ||
- './tests/rust-integration-tests/integration_test/**' | ||
tests/rust-integration-tests/test_framework: | ||
- './tests/rust-integration-tests/test_framework/**' | ||
files_ignore: | | ||
docs | ||
LICENSE | ||
**.md | ||
- name: List all changed files | ||
run: | | ||
for file in ${{ steps.filter.outputs.all_modified_files }}; do | ||
echo "$file was changed" | ||
done | ||
check: | ||
needs: [changes] | ||
if: ${{ !contains(needs.changes.outputs.dirs, '[]') }} | ||
runs-on: ubuntu-20.04 | ||
if: needs.changes.outputs.any_modified == 'true' | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 15 | ||
strategy: | ||
matrix: | ||
dirs: ${{ fromJSON(needs.changes.outputs.dirs) }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Rust toolchain and cache | ||
uses: actions-rust-lang/[email protected] | ||
- run: rustup component add rustfmt clippy | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
with: | ||
components: rustfmt, clippy | ||
- uses: taiki-e/install-action@just | ||
- name: Install requirements | ||
run: sudo ./.github/scripts/dependency.sh | ||
- run: sudo apt-get install -y pkg-config libsystemd-dev libdbus-glib-1-dev libelf-dev libseccomp-dev | ||
- name: Check formatting | ||
run: cargo fmt --all -- --check | ||
working-directory: ${{matrix.dirs}} | ||
- name: Check clippy lints | ||
working-directory: ${{matrix.dirs}} | ||
run: cargo clippy --all-targets --all-features -- -D warnings | ||
run: just prepare | ||
- name: Check formatting and lints | ||
run: just lint | ||
|
||
tests: | ||
runs-on: ubuntu-20.04 | ||
needs: [changes] | ||
if: needs.changes.outputs.any_modified == 'true' | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 15 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Install rus | ||
run: rustup show | ||
- run: sudo apt-get -y update | ||
- run: sudo apt-get install -y pkg-config libsystemd-dev libdbus-glib-1-dev libelf-dev libseccomp-dev | ||
- name: Setup Rust toolchain and cache | ||
uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
- uses: taiki-e/install-action@just | ||
- name: Install requirements | ||
run: just prepare | ||
- name: Run tests | ||
run: | | ||
export LD_LIBRARY_PATH=$HOME/.wasmedge/lib | ||
cd ./crates && cargo test --all --all-features --no-fail-fast | ||
coverage: | ||
runs-on: ubuntu-20.04 | ||
needs: [changes] | ||
if: needs.changes.outputs.any_modified == 'true' | ||
runs-on: ubuntu-22.04 | ||
timeout-minutes: 15 | ||
name: Run test coverage | ||
name: run test coverage | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup Rust toolchain and cache | ||
|
@@ -83,37 +77,15 @@ jobs: | |
uses: taiki-e/install-action@v1 | ||
with: | ||
tool: [email protected] | ||
- uses: taiki-e/install-action@just | ||
- name: Install requirements | ||
run: sudo ./.github/scripts/dependency.sh | ||
run: just prepare | ||
- name: Run Test Coverage for youki | ||
run: | | ||
cargo llvm-cov clean --workspace | ||
cargo llvm-cov --no-report | ||
cargo llvm-cov --no-run --lcov --ignore-filename-regex "libcgroups/src/systemd/dbus/systemd_api.rs" --output-path ./coverage.lcov | ||
- name: Upload Youki Code Coverage Results | ||
uses: codecov/codecov-action@v2 | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
file: ./coverage.lcov | ||
|
||
integration_tests: | ||
runs-on: ubuntu-20.04 | ||
timeout-minutes: 15 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- name: Setup Rust toolchain and cache | ||
uses: actions-rust-lang/[email protected] | ||
- name: Install requirements | ||
run: sudo ./.github/scripts/dependency.sh | ||
- name: Install just | ||
uses: taiki-e/install-action@just | ||
- uses: actions/setup-go@v3 | ||
with: | ||
go-version: "1.17.6" | ||
cache: true | ||
cache-dependency-path: tests/oci-runtime-tests/src/github.com/opencontainers/runtime-tools/go.sum | ||
- name: Build | ||
run: just youki-release | ||
- name: Run integration tests | ||
run: just oci-tests |
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