Workflow file for this run
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
name: "Run integration tests against latest commit of wasmer-cli" | |
on: | |
schedule: | |
- cron: 0 0 * * * | |
push: | |
branches: | |
- "sre-229-run-integration-tests-agianst-wasmer-cli-daily" | |
jobs: | |
build-wasmer: | |
name: Build on ${{ matrix.build }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- build: linux-x64 | |
os: ubuntu-20.04 | |
artifact_name: 'wasmer-linux-amd64' | |
llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/15.x/llvm-linux-amd64.tar.xz' | |
cross_compilation_artifact_name: 'cross_compiled_from_linux' | |
use_sccache: false | |
use_llvm: true | |
build_wasm: true | |
container: ${{ matrix.container }} | |
env: | |
SCCACHE_AZURE_BLOB_CONTAINER: wasmerstoragesccacheblob | |
SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.SCCACHE_AZURE_CONNECTION_STRING }} | |
TARGET: ${{ matrix.target }} | |
RUST_BACKTRACE: 1 | |
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: git | |
MSRV: "1.73" | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
repository: 'wasmerio/wasmer' | |
- name: Set up base deps on musl | |
if: matrix.build == 'linux-musl-x64' | |
run: ./scripts/alpine-linux-install-deps.sh | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: ${{ env.MSRV }} | |
target: ${{ matrix.target }} | |
- uses: Swatinem/rust-cache@v2 | |
if: matrix.use_sccache != true | |
- name: Install LLVM (macOS Apple Silicon) | |
if: matrix.os == 'macos-11.0' && !matrix.llvm_url | |
run: | | |
brew install llvm | |
- name: Install LLVM | |
if: matrix.llvm_url | |
shell: bash | |
run: | | |
LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} | |
mkdir -p ${LLVM_DIR} | |
curl --proto '=https' --tlsv1.2 -sSf "${{ matrix.llvm_url }}" -L -o - | tar xJv -C ${LLVM_DIR} | |
echo "${LLVM_DIR}/bin" >> $GITHUB_PATH | |
env: | |
LLVM_DIR: .llvm | |
- name: Configure LLVM (Windows) | |
# The Custom Windows build does not contains llvm-config.exe, so need to setup manualy here | |
if: matrix.build == 'windows-x64' && matrix.llvm_url | |
shell: bash | |
run: | | |
LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }} | |
echo LLVM_SYS_150_PREFIX="${LLVM_DIR}" >> $GITHUB_ENV | |
echo LLVM_ENABLE=1 >> $GITHUB_ENV | |
env: | |
LLVM_DIR: .llvm | |
- name: Set up dependencies for Mac OS | |
run: | | |
brew install automake | |
# using gnu-tar is a workaround for https://github.com/actions/cache/issues/403 | |
brew install gnu-tar | |
echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV | |
if: matrix.os == 'macos-latest' || matrix.os == 'macos-11.0' | |
- uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
key: ${{ matrix.build }}-${{ matrix.target }}-cargo-${{ hashFiles('Cargo.lock') }}-v1 | |
- uses: actions/cache@v2 | |
if: matrix.use_sccache | |
with: | |
path: ${{ runner.tool_cache }}/cargo-sccache | |
key: ${{ matrix.build }}-${{ matrix.target }}-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}-v1 | |
- name: Install sccache | |
if: matrix.use_sccache | |
run: | | |
if [ ! -f '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' ]; then | |
cargo install sccache --no-default-features --features=dist-client,azure --root '${{ runner.tool_cache }}/cargo-sccache' | |
fi | |
shell: bash | |
- name: Setup Rust target | |
run: | | |
mkdir -p .cargo | |
cat << EOF > .cargo/config.toml | |
[build] | |
target = "${{ matrix.target }}" | |
EOF | |
if: matrix.target | |
- name: Set sccache port | |
if: matrix.use_sccache && matrix.random_sccache_port | |
run: | | |
netstat -aln | awk ' | |
$6 == "LISTEN" { | |
if ($4 ~ "[.:][0-9]+$") { | |
n = split($4, a, /[:.]/); | |
port = a[n]; | |
p[port] = 1 | |
} | |
} | |
END { | |
for (i = 3000; i < 65000 && p[i]; i++){}; | |
if (i == 65000) {exit 1}; | |
print "SCCACHE_SERVER_PORT=" i | |
} | |
' >> $GITHUB_ENV | |
# echo "SCCACHE_SERVER_PORT=9000" | |
echo "Setting random sccache port to: $SCCACHE_SERVER_PORT" | |
shell: bash | |
- name: Start sccache | |
if: matrix.use_sccache | |
run: | | |
chmod +x '${{ runner.tool_cache }}/cargo-sccache/bin/sccache' | |
'${{ runner.tool_cache }}/cargo-sccache/bin/sccache' --start-server | |
'${{ runner.tool_cache }}/cargo-sccache/bin/sccache' -s | |
echo 'RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache' >> $GITHUB_ENV | |
shell: bash | |
- name: Build C API headless | |
shell: bash | |
run: | | |
make package-capi-headless | |
- name: Build C API | |
shell: bash | |
run: | | |
make build-capi | |
- name: Build Wasmer binary with LLVM | |
if: matrix.use_llvm | |
shell: bash | |
run: | | |
make build-wasmer | |
env: | |
ENABLE_LLVM: 1 | |
- name: Build Wasmer binary without LLVM | |
if: matrix.use_llvm != true | |
shell: bash | |
run: | | |
make build-wasmer | |
#- name: Build Wasmer binary on Wasm32-WASI without LLVM | |
# if: matrix.build_wasm | |
# shell: bash | |
# run: | | |
# make build-wasmer-wasm | |
- name: Install Nightly Rust for Headless | |
if: matrix.build != 'linux-musl-x64' | |
uses: dtolnay/rust-toolchain@master | |
with: | |
toolchain: "nightly-2023-10-05" | |
target: ${{ matrix.target }} | |
components: "rust-src" | |
- name: Build Minimal Wasmer Headless | |
if: matrix.build != 'linux-musl-x64' | |
run: | | |
cargo install xargo | |
echo "" >> Cargo.toml | |
echo "[profile.release]" >> Cargo.toml | |
echo "opt-level = 'z'" >> Cargo.toml | |
echo "debug = false" >> Cargo.toml | |
echo "debug-assertions = false" >> Cargo.toml | |
echo "overflow-checks = false" >> Cargo.toml | |
echo "lto = true" >> Cargo.toml | |
echo "panic = 'abort'" >> Cargo.toml | |
echo "incremental = false" >> Cargo.toml | |
echo "codegen-units = 1" >> Cargo.toml | |
echo "rpath = false" >> Cargo.toml | |
rustup override set nightly-2023-10-05 | |
make build-wasmer-headless-minimal | |
rustup override unset | |
- name: Dist | |
run: | | |
make distribution | |
- name: Upload Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ${{ matrix.artifact_name }} | |
path: dist | |
if-no-files-found: error | |
retention-days: 2 | |
integration-test: | |
name: test | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout backend | |
uses: actions/checkout@v3 | |
- name: Download wasmer build | |
uses: actions/download-artifact@v3 | |
with: | |
name: wasmer-linux-amd64 | |
path: /usr/bin/wasmer | |
- id: 'auth' | |
uses: 'google-github-actions/auth@v1' | |
with: | |
credentials_json: '${{ secrets.GCP_KEY }}' | |
- uses: google-github-actions/setup-gcloud@v1 | |
with: | |
version: '410.0.0' | |
project_id: ${{ secrets.GKE_PROJECT }} | |
- run: |- | |
gcloud --quiet auth configure-docker | |
- name: Setup python environment | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.11" | |
- name: Setup poetry | |
run: | | |
pip install poetry | |
poetry --version | |
- name: unlock backend with git-crypt | |
run: | | |
sudo apt install -y git-crypt | |
echo $GIT_CRYPT_KEY | base64 -d > git-crypt.key | |
git crypt unlock git-crypt.key | |
env: | |
GIT_CRYPT_KEY: ${{ secrets.GIT_CRYPT_KEY_BASE64 }} | |
- name: setup intergation tests | |
run: | | |
make | |
- name: Run intergation tests | |
run: | | |
make test | |
env: | |
WASMER_TOKEN: wap_default_token | |
WASMER_REGISTRY: "http://localhost:8000/graphql" | |
WASMER_TEST_NAMESPACE: "wasmer-tests" |