Add conda
, pyenv
, pyenv-win
, pipenv
, pyenv-virtualenv
, virtualenvwrapper
#34
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: 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 | |
- os: windows-latest | |
target: aarch64-pc-windows-msvc | |
- os: ubuntu-latest | |
target: x86_64-unknown-linux-musl | |
# - os: ubuntu-latest | |
# target: aarch64-unknown-linux-gnu | |
# - os: ubuntu-latest | |
# target: arm-unknown-linux-gnueabihf | |
- os: macos-latest | |
target: x86_64-apple-darwin | |
- os: macos-14 | |
target: aarch64-apple-darwin | |
# - 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: Add Conda to PATH | |
if: startsWith( matrix.os, 'windows') || 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: Install pipenv | |
run: pip install --user pipenv | |
shell: bash | |
- name: Check pipenv version | |
run: pipenv --version | |
- name: Install virtualnvwrapper | |
if: startsWith( matrix.os, 'ubuntu') || startsWith( matrix.os, 'macos') | |
run: | | |
pip install --user virtualenvwrapper | |
echo "WORKON_HOME=$HOME/.virtualenvs" >> $GITHUB_ENV | |
shell: bash | |
- name: Install virtualnvwrapper-win | |
if: startsWith( matrix.os, 'windows') | |
run: | | |
pip install --user virtualenvwrapper-win | |
echo "WORKON_HOME=$USERPROFILE/.virtualenvs" >> $GITHUB_ENV | |
shell: bash | |
- name: Install pyenv | |
if: startsWith( matrix.os, 'windows') | |
run: | | |
choco install pyenv-win -y | |
echo "PATH=$PATH;$USERPROFILE/.pyenv/pyenv-win/bin;$USERPROFILE/.pyenv/pyenv-win/shims" >> $GITHUB_ENV | |
echo "PYENV_ROOT=$USERPROFILE/.pyenv/pyenv-win" >> $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 | |
- name: Install Pyenv Python(s) | |
run: pyenv install 3.12.3 3.11.9 3.10.14 3.9.19 3.8.19 | |
- name: Python in Registry | |
if: startsWith( matrix.os, 'windows') | |
run: reg query HKLM\SOFTWARE\Python /s | |
- name: Rust Tool Chain setup | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
targets: ${{ matrix.target }} | |
- name: Cargo Fetch | |
run: cargo fetch | |
- name: Run Tests | |
run: cargo test --frozen --all-features | |
- name: Build | |
run: cargo build --release --target ${{ matrix.target }} | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pet-${{ matrix.target }} | |
path: target/${{ matrix.target }}/release/pet* |