feat: add justfile, setup CI #19
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: Python CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
python: | |
name: Python Test | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
rust: | |
- stable | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
- uses: extractions/setup-just@v1 | |
- name: Install poetry | |
run: pipx install poetry | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
cache: 'poetry' | |
- run: poetry install | |
- name: download extism development release | |
run: | | |
set -eou pipefail | |
arch="$(<<<'${{ runner.arch }}' sed -e 's/ARM64/aarch64/g')" | |
arch="${arch/X64/x86_64}" | |
os="$(<<<'${{ runner.os }}' tr '[:upper:]' '[:lower:]')" | |
os="${os/macos/darwin}" | |
echo "attempting to download 'libextism-${arch}-${os}-*.tar.gz'" | |
gh release -R extism/extism download latest -p "libextism-${arch}-*${os}-*.tar.gz" | |
tar zxfv *.tar.gz | |
sudo mv libextism.* /usr/local/lib/ | |
sudo mv extism.h /usr/local/include/ | |
env: | |
GH_TOKEN: ${{ github.token }} | |
- name: Run Python lint | |
run: | | |
just lint | |
- name: Run Python tests | |
run: | | |
just test | |
- name: Run Python docs | |
run: | | |
just docs |