Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

turn on musl test in CI #2069

Merged
merged 2 commits into from
Jun 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,34 @@ jobs:
export LD_LIBRARY_PATH=$HOME/.wasmedge/lib
cd ./crates && cargo test --all --all-features --no-fail-fast
- name: Run feature tests
run: just featuretest
run: just test-features

# musl target testing is religated to a separate job because our current build
# for musl requires nightly. It is difficult to mix stable and nightly
# toolchains in the same job.
musl:
needs: [changes]
if: needs.changes.outputs.any_modified == 'true'
runs-on: ubuntu-22.04
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
# We do not use `actions-rust-lang/setup-rust-toolchain` here because we
# want to override the default toolchain file to use nightly toolchains.
# The `setup-rust-toolchain` action will always choose toolchain file with
# no way to override.
- name: Setup Rust toolchain and cache
uses: dtolnay/rust-toolchain@v1
with:
toolchain: nightly
target: x86_64-unknown-linux-musl
components: rust-src
- uses: taiki-e/install-action@just
- name: Install requirements
run: sudo env PATH=$PATH just ci-musl-prepare
- name: Run test against musl target
run: just test-musl


coverage:
needs: [changes]
Expand Down
28 changes: 26 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,21 @@ rust-oci-tests-bin:
test-oci: oci-tests rust-oci-tests

# run all tests except rust-oci
test-all: unittest featuretest oci-tests containerd-test # currently not doing rust-oci here
test-all: unittest test-features oci-tests containerd-test # currently not doing rust-oci here

# run cargo unittests
unittest:
cd ./crates
LD_LIBRARY_PATH=${HOME}/.wasmedge/lib cargo test --all --all-targets --all-features

# run permutated feature compilation tests
featuretest:
test-features:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

{{ cwd }}/scripts/features_test.sh

# run test against musl target
test-musl:
{{ cwd }}/scripts/musl_test.sh

# run oci integration tests
oci-tests:
{{ cwd }}/scripts/oci_integration_tests.sh {{ cwd }}
Expand Down Expand Up @@ -143,3 +147,23 @@ ci-prepare:

echo "Unknown system. The CI is only configured for Ubuntu. You will need to forge your own path. Good luck!"
exit 1

ci-musl-prepare: ci-prepare
#!/usr/bin/env bash
set -euo pipefail

# Check if system is Ubuntu
if [[ -f /etc/lsb-release ]]; then
source /etc/lsb-release
if [[ $DISTRIB_ID == "Ubuntu" ]]; then
echo "System is Ubuntu"
apt-get -y update
apt-get install -y \
musl-dev \
musl-tools
exit 0
fi
fi

echo "Unknown system. The CI is only configured for Ubuntu. You will need to forge your own path. Good luck!"
exit 1
File renamed without changes.