Skip to content

Update devcontainers #327

Update devcontainers

Update devcontainers #327

Workflow file for this run

name: PR/CI Check
on:
pull_request:
push:
branches-ignore:
- main
- release*
- release/*
- release-*
jobs:
tests:
name: Tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
run_cli: "yes"
- os: windows-latest
target: aarch64-pc-windows-msvc
run_cli: "no"
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
run_cli: "yes"
# - os: ubuntu-latest
# target: aarch64-unknown-linux-gnu
# - os: ubuntu-latest
# target: arm-unknown-linux-gnueabihf
- os: macos-latest
target: x86_64-apple-darwin
run_cli: "yes"
- os: macos-14
target: aarch64-apple-darwin
run_cli: "yes"
# - os: ubuntu-latest
# target: x86_64-unknown-linux-gnu
# - os: ubuntu-latest
# target: aarch64-unknown-linux-musl
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set Python to PATH
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Homebrew Python
if: startsWith( matrix.os, 'macos')
run: brew install python
shell: bash
- name: Add Conda to PATH
if: startsWith( matrix.os, 'windows')
run: |
$path = $env:PATH + ";" + $env:CONDA + "\condabin"
echo "PATH=$path" >> $env:GITHUB_ENV
- name: Add Conda to PATH
if: startsWith( matrix.os, 'ubuntu')
run: echo "PATH=$PATH:$CONDA/condabin" >> $GITHUB_ENV
shell: bash
- name: Install Conda + add to PATH
if: startsWith( matrix.os, 'macos')
run: |
curl -o ~/miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
bash ~/miniconda.sh -b -p ~/miniconda
echo "PATH=$PATH:$HOME/miniconda/bin" >> $GITHUB_ENV
echo "CONDA=$HOME/miniconda" >> $GITHUB_ENV
shell: bash
- name: Check Conda version
run: conda info --all
- name: Create Conda Environments
run: |
conda create -n test-env1 python=3.12 -y
conda create -n test-env-no-python -y
conda create -p ./prefix-envs/.conda1 python=3.12 -y
conda create -p ./prefix-envs/.conda-nopy -y
- name: Install pipenv
run: pip install pipenv
- name: Check pipenv version
run: pipenv --version
- name: Install virtualenvwrapper
# Activation of the script doesn't work on mac for some reason (didn't check why yet)
# But linux is sufficient for the tests
if: startsWith( matrix.os, 'ubuntu')
run: |
pip install virtualenvwrapper
echo "WORKON_HOME=$HOME/.virtualenvs" >> $GITHUB_ENV
mkdir -p $HOME/.virtualenvs
source virtualenvwrapper.sh
mkvirtualenv venv_wrapper_env1
shell: bash
- name: Install virtualenvwrapper-win
if: startsWith( matrix.os, 'windows')
run: |
pip install virtualenvwrapper-win
echo "WORKON_HOME=$HOME/.virtualenvs" >> $GITHUB_ENV
shell: bash
- name: Install pyenv
if: startsWith( matrix.os, 'windows')
run: |
choco install pyenv-win -y
echo "PATH=$PATH;$HOME/.pyenv/pyenv-win/bin;$HOME/.pyenv/pyenv-win/shims" >> $GITHUB_ENV
echo "PYENV_ROOT=$HOME/.pyenv" >> $GITHUB_ENV
shell: bash
- name: Install pyenv and pyenv-virtualenv
if: startsWith( matrix.os, 'ubuntu') || startsWith( matrix.os, 'macos')
run: |
curl https://pyenv.run | bash
echo "PYENV_ROOT=$HOME/.pyenv" >> $GITHUB_ENV
echo "PATH=$HOME/.pyenv/bin:$PATH" >> $GITHUB_ENV
shell: bash
- name: Check Pyenv version
run: pyenv --version
shell: bash
- name: Install Pyenv Python(s)
if: startsWith( matrix.os, 'ubuntu') || startsWith( matrix.os, 'macos')
run: |
pyenv install --list
pyenv install 3.12.3 3.8.19
shell: bash
# pyenv-win install list has not updated for a while
- name: Install Pyenv Python(s)
if: startsWith( matrix.os, 'windows')
run: |
pyenv install --list
pyenv install 3.10.5 3.8.10
shell: bash
- name: Create pyenv-virtualenv envs
if: startsWith( matrix.os, 'ubuntu') || startsWith( matrix.os, 'macos')
run: |
eval "$(pyenv virtualenv-init -)"
pyenv virtualenv 3.12 pyenv-virtualenv-env1
shell: bash
- name: Rust Tool Chain setup
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: ${{ matrix.target }}
- name: Cargo Fetch
run: cargo fetch
shell: bash
- name: Run Tests
run: cargo test --frozen --all-features -- --nocapture
shell: bash
- name: Find Environments
if: matrix.run_cli == 'yes'
run: cargo run --release --target ${{ matrix.target }}
shell: bash
builds:
name: Builds
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: windows-latest
target: aarch64-pc-windows-msvc
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
run_cli: "yes"
# - os: ubuntu-latest
# target: aarch64-unknown-linux-gnu
# - os: ubuntu-latest
# target: arm-unknown-linux-gnueabihf
- os: macos-latest
target: x86_64-apple-darwin
run_cli: "yes"
- os: macos-14
target: aarch64-apple-darwin
run_cli: "yes"
# - os: ubuntu-latest
# target: x86_64-unknown-linux-gnu
# - os: ubuntu-latest
# target: aarch64-unknown-linux-musl
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Rust Tool Chain setup
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: ${{ matrix.target }}
- name: Cargo Fetch
run: cargo fetch
shell: bash
- name: Run Tests
# We do not want to run all features, CI is only for tests with Python
# Thats a separate job.
run: cargo test --frozen
shell: bash
- name: Build
run: cargo build --release --target ${{ matrix.target }}
shell: bash
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: pet-${{ matrix.target }}
path: target/${{ matrix.target }}/release/pet*