Renaming classes #612
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
# https://docs.github.com/en/actions/using-workflows/reusing-workflows#calling-a-reusable-workflow | |
# https://docs.github.com/fr/actions/using-workflows/workflow-syntax-for-github-actions#exemple--inclusion-de-chemins-dacc%C3%A8s | |
name: Full CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
# Concurrency : auto-cancel "old" jobs ie when pushing again | |
# https://docs.github.com/fr/actions/using-jobs/using-concurrency | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref || github.run_id }} | |
cancel-in-progress: true | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
build-python: | |
name: "Python ${{ matrix.python-version }} on ${{ matrix.os }}" | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false # Do not stop when any job fails | |
matrix: | |
python-version: ["3.10", "3.11"] | |
os: [ubuntu-latest] | |
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources | |
continue-on-error: false # https://ncorti.com/blog/howto-github-actions-build-matrix | |
steps: | |
- name: Checkout code | |
uses: actions/[email protected] | |
with: | |
fetch-depth: 0 | |
- name: Check disk space | |
run: | | |
df -h | |
- name: Free disk space | |
run: | | |
sudo swapoff -a | |
sudo rm -f /swapfile | |
sudo rm -rf /usr/local/lib/android | |
docker rmi $(docker image ls -aq) | |
sudo apt update && sudo apt remove -y \ | |
google-cloud-cli microsoft-edge-stable dotnet-sdk-* llvm-* google-chrome-stable temurin-* | |
sudo apt autoremove -y | |
sudo apt autoclean -y | |
- name: Check new disk space | |
run: | | |
df -h | |
- name: Setup PDM | |
uses: pdm-project/setup-pdm@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: false # Removing cache, as it's not worth for now (around 3min to restore + time to save vs 3 min to clean install) | |
- name: Install dependencies | |
run: pdm install -G :all | |
- name: Ensure opencv contrib is working | |
run: | | |
pdm run pip uninstall -y opencv-contrib-python | |
pdm run pip install opencv-contrib-python | |
- name: Ensure torch is installed correctly on gh runner | |
run: | | |
pdm run pip install -U torch==2.1.0+cu121 torchvision==0.16.0+cu121 --index-url https://download.pytorch.org/whl/cu121 | |
- name: Verify linting, format | |
run: pdm check-format | |
- name: Cache test resources | |
uses: actions/cache@v3 | |
if: ${{ github.event_name == 'pull_request' }} | |
with: | |
path: ~/.giskard | |
key: ${{ matrix.os }}-python-${{ matrix.python-version }}-test-resources # TODO: Separate fixtures and for hashing | |
restore-keys: ${{ matrix.os }}-python-${{ matrix.python-version }}-test-resources | |
- name: Test code | |
run: pdm test | |
- name: Test notebooks | |
run: pdm check-notebook | |
- name: Build | |
run: pdm build | |
- name: "Python client: archive built artifacts" | |
if: ${{ github.event_name == 'push' && matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10' }} | |
uses: actions/upload-artifact@v3 | |
with: | |
path: dist/*whl | |
install-pip: | |
name: "Check if wheel can be installed with pip" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/[email protected] | |
- name: Setup PDM | |
uses: pdm-project/setup-pdm@v3 | |
with: | |
python-version: "3.10" | |
cache: false | |
- name: Build wheel | |
run: pdm build | |
- name: Create new project, install wheel and import (Pip) | |
run: | | |
python -m venv .venv-test-pip | |
source .venv-test-pip/bin/activate | |
python -m pip install "$(ls ./dist/*.whl)" | |
python -c "import giskard_vision" |