Skip to content

chore(deps): update wasmer-types requirement from 2.1.1 to 4.2.0 in /packages/api #1524

chore(deps): update wasmer-types requirement from 2.1.1 to 4.2.0 in /packages/api

chore(deps): update wasmer-types requirement from 2.1.1 to 4.2.0 in /packages/api #1524

Workflow file for this run

name: Build and Test
on:
push:
branches:
- master
- staging
- trying
- 'prepare-*'
pull_request:
branches:
- '**'
# Allow one concurrent deployment
concurrency:
group: ${{ github.ref }}-test
cancel-in-progress: true
jobs:
test:
name: Build and Test
strategy:
matrix:
python: ["3.7", "3.8", "3.9", "3.10", "3.11"]
target:
- id: 'linux-amd64'
os: 'ubuntu-latest'
target-name: 'x86_64-unknown-linux-gnu'
rust-toolchain: 'stable'
llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-linux-gnu-ubuntu-16.04.tar.xz'
#- id: 'linux-aarch64'
# os: ['self-hosted', 'linux', 'ARM64', 'python']
# target-name: 'aarch64-unknown-linux-gnu'
# rust-toolchain: 'stable'
# llvm-archive-url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/11.x/linux-aarch64.tar.gz'
- id: 'darwin-amd64'
os: 'macos-latest'
target-name: 'x86_64-apple-darwin'
rust-toolchain: 'stable'
llvm_url: 'https://github.com/llvm/llvm-project/releases/download/llvmorg-13.0.0/clang+llvm-13.0.0-x86_64-apple-darwin.tar.xz'
- id: 'windows-amd64'
os: 'windows-latest'
target-name: 'x86_64-pc-windows-msvc'
rust-toolchain: 'stable'
# llvm_url: 'https://github.com/wasmerio/llvm-custom-builds/releases/download/11.x/windows-amd64.tar.gz'
llvm_choco_version: 13.0.0
fail-fast: false
runs-on: ${{ matrix.target.os }}
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Install dependencies
if: matrix.target.id == 'linux-amd64'
run: |
sudo apt-get update -y
sudo apt-get install libtinfo5
echo "LD_LIBRARY_PATH=/lib/x86_64-linux-gnu" >> $GITHUB_ENV
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.target.rust-toolchain }}
default: true
override: true
target: ${{ matrix.target.target-name }}
# Caching is disabled because it interferes with artifact creation
# - uses: Swatinem/rust-cache@v2
# with:
# shared-key: "rust-cache"
- name: Set current Python version
shell: bash
run: |
echo "${{ matrix.python }}" > .python-version
- name: Set up Python ${{ matrix.python }} (amd64)
if: matrix.target.id != 'linux-aarch64'
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
architecture: x64
- name: Set up Python ${{ matrix.python }} (aarch64)
if: matrix.target.id == 'linux-aarch64'
shell: bash
run: |
test -d $HOME/.pyenv || curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
pyenv install --list | grep '^ ${{ matrix.python }}' | tail -n 1 | tr -d '[:space:]' > .python-version
pyenv install --skip-existing "$(cat .python-version)"
- name: Validate python version
run: |
$pythonVersionFull = (python --version)
$pythonVersion = $pythonVersionFull -replace '\.(\d+)$',''
if ("Python ${{ matrix.python }}" -ne "$pythonVersion"){
Write-Host "The current version is $pythonVersion; expected version is ${{ matrix.python }}"
exit 1
}
$pythonVersion
shell: pwsh
- name: Print python version (verbose)
run: |
python -VV
shell: pwsh
- name: Install LLVM (Choco - Windows)
if: matrix.target.llvm_choco_version
shell: bash
run: |
choco install llvm --version ${{ matrix.target.llvm_choco_version }} --allow-downgrade
cd 'C:\Program Files\LLVM\'
LLVM_DIR=$(pwd)
echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV
- name: Install LLVM
if: matrix.target.llvm_url
shell: bash
run: |
curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.target.llvm_url }} -L -o llvm.tar.xz
LLVM_DIR=$(pwd)/${{ env.LLVM_DIR }}
mkdir ${LLVM_DIR}
tar xf llvm.tar.xz --strip-components=1 -C ${LLVM_DIR}
echo "${LLVM_DIR}/bin" >> $GITHUB_PATH
echo "LLVM_SYS_120_PREFIX=${LLVM_DIR}" >> $GITHUB_ENV
env:
LLVM_DIR: .llvm
- name: Set up utilities
shell: bash
run: |
export PATH="$HOME/.cargo/bin:$PATH"
export PATH="$HOME/.pyenv/versions/$(cat .python-version)/bin:$PATH"
test -f $HOME/.cargo/bin/just || cargo install just
test -f $HOME/.cargo/bin/fd || cargo install fd-find
- name: Set up extra utilities for macOS
if: matrix.target.id == 'darwin-amd64'
shell: bash
run: |
brew install gnu-sed
- name: Set build number when automatically pre-releasing
if: startsWith(github.ref, 'refs/heads/prepare-')
shell: bash
run: |
scripts/update-version.sh "$(scripts/update-version.sh --get)-rc${{ github.run_id }}"
- name: Install the prelude
shell: bash
run: |
export PATH="$HOME/.cargo/bin:$PATH"
export PATH="$HOME/.pyenv/versions/$(cat .python-version)/bin:$PATH"
just prelude
- name: Compile the library
shell: bash
run: |
export PATH="$HOME/.cargo/bin:$PATH"
export PATH="$HOME/.pyenv/versions/$(cat .python-version)/bin:$PATH"
if test -d .env/bin/; then source .env/bin/activate; else source .env/Scripts/activate; fi
maturin list-python
PYTHON_INTERPRETER=$(maturin list-python 2>&1 | grep -o "CPython $(cat .python-version | grep -o -E '^[^\.]+\.[^\.]+').* at .*" | cut -d' ' -f 4 | tr '\\' '/')
echo "Selected interpreter: ${PYTHON_INTERPRETER}"
just build-all "${{ matrix.target.target-name }}"
- name: Run all the tests
shell: bash
run: |
export PATH="$HOME/.cargo/bin:$PATH"
export PATH="$HOME/.pyenv/versions/$(cat .python-version)/bin:$PATH"
if test -d .env/bin/; then source .env/bin/activate; else source .env/Scripts/activate; fi
just test
- name: Build the wheels
shell: bash
run: |
export PATH="$HOME/.cargo/bin:$PATH"
export PATH="$HOME/.pyenv/versions/$(cat .python-version)/bin:$PATH"
if test -d .env/bin/; then source .env/bin/activate; else source .env/Scripts/activate; fi
maturin list-python
PYTHON_INTERPRETER=$(maturin list-python 2>&1 | grep -o "CPython $(cat .python-version | grep -o -E '^[^\.]+\.[^\.]+').* at .*" | cut -d' ' -f 4 | tr '\\' '/')
echo "Selected interpreter: ${PYTHON_INTERPRETER}"
just build-all-wheels "${PYTHON_INTERPRETER}" "${{ matrix.target.target-name }}"
just build-any-wheel
- name: Inspect wheels
shell: bash
run: |
ls -lhaGiR target/wheels/*.whl
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: wheels-${{ matrix.python }}-${{ matrix.target.id }}
path: target/wheels
if-no-files-found: error
retention-days: 1
prerelease:
name: Pre-Release
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/heads/prepare-')
needs: [test]
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Download the Artifacts
uses: actions/download-artifact@v2
with:
path: artifacts
- name: Inspect artifacts
shell: bash
run: |
ls -lhaGiR artifacts/*
- name: Set current Python version
shell: bash
run: |
echo "3.11" > .python-version
- name: Set up Python ${{ matrix.python }} (amd64)
if: matrix.target.id != 'linux-aarch64'
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Set up Python ${{ matrix.python }} (aarch64)
if: matrix.target.id == 'linux-aarch64'
shell: bash
run: |
test -d $HOME/.pyenv || curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
pyenv install --list | grep '^ 3.11' | tail -n 1 | tr -d '[:space:]' > .python-version
pyenv install --skip-existing "$(cat .python-version)"
# Caching is disabled because it interferes with artifact creation
#- uses: Swatinem/rust-cache@v1
- name: Set up just
shell: bash
run: |
export PATH="$HOME/.cargo/bin:$PATH"
export PATH="$HOME/.pyenv/versions/$(cat .python-version)/bin:$PATH"
test -f $HOME/.cargo/bin/just || cargo install just
- name: Prelude
shell: bash
run: |
export PATH="$HOME/.cargo/bin:$PATH"
export PATH="$HOME/.pyenv/versions/$(cat .python-version)/bin:$PATH"
just prelude
- name: Publish the wheels on TestPyPI
shell: bash
env:
TWINE_PASSWORD: ${{ secrets.MATURIN_PASSWORD }}
run: |
export PATH="$HOME/.local/bin:$HOME/.cargo/bin:$PATH"
export PATH="$HOME/.pyenv/versions/$(cat .python-version)/bin:$PATH"
if test -d .env/bin/; then source .env/bin/activate; else source .env/Scripts/activate; fi
just publish testpypi $(ls artifacts/wheels-*/*.whl | tr '/' '\t' | sort -k 3 | uniq -f 2 | tr '\t' '/' | grep --invert-match aarch64)
build-status:
if: always() && github.event_name == 'push'
runs-on: ubuntu-latest
needs: [test]
steps:
- name: Mark the job as succeeded
if: needs.test.result == 'success'
run: exit 0
- name: Mark the job as failed
if: needs.test.result != 'success'
run: exit 1