Skip to content

Merge pull request #1 from GT4SD/main #1113

Merge pull request #1 from GT4SD/main

Merge pull request #1 from GT4SD/main #1113

Workflow file for this run

name: "Running tests: style, pytests and entry-points"
env:
GT4SD_CI: true
on:
pull_request:
types: [opened, reopened, synchronize, ready_for_review]
push:
branches:
- "**"
- "!gh-pages"
jobs:
tests:
runs-on: ubuntu-latest
permissions:
contents: read
defaults:
run:
shell: bash -l {0} # for conda command
env:
GIT_CLONE_PROTECTION_ACTIVE: false
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: gt4sd
environment-file: conda_cpu_linux.yml
auto-activate-base: false
use-only-tar-bz2: true
- name: Install gt4sd from source
run: |
conda activate gt4sd
pip install --no-deps .
- name: Check black
run: |
conda activate gt4sd
python -m black src/gt4sd --check --diff --color
- name: Remove unnecessary files (see https://stackoverflow.com/questions/75536771/github-runner-out-of-disk-space-after-building-docker-image)
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- name: Check flake8
run: |
conda activate gt4sd
python -m flake8 --disable-noqa --per-file-ignores="__init__.py:F401" src/gt4sd
- name: Check mypy
run: |
conda activate gt4sd
python -m mypy src/gt4sd --show-traceback
- name: Run pytests
run: |
conda activate gt4sd
python -m pytest -sv
- name: Test entry-points
run: |
conda activate gt4sd
gt4sd-trainer --help
gt4sd-inference --help
gt4sd-saving --help
gt4sd-upload --help
gt4sd-pl-to-hf --help
gt4sd-hf-to-st --help