Skip to content

Commit

Permalink
Rework actions
Browse files Browse the repository at this point in the history
  • Loading branch information
talmo committed Apr 8, 2024
1 parent 4c0b7ca commit 1ace179
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .conda/condarc.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
channels:
- conda-forge
- nvidia
# - https://conda.anaconda.org/sleap/label/dev
- https://conda.anaconda.org/sleap/label/dev
- sleap
- anaconda
3 changes: 1 addition & 2 deletions .github/workflows/build_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,13 @@ jobs:
pip install '$wheel_path'[dev]
- test_args: pytest --durations=-1 tests/
- condarc: .conda/condarc.yaml
- pyver: 3.7
# Use special condarc if macos
- os: "macos-14"
condarc: .conda_mac/condarc.yaml
pyver: 3.10
# Ubuntu specific values
- os: ubuntu-22.04
pyver: 3.7
# Otherwise core dumped in github actions
test_args: |
sudo apt install xvfb libxkbcommon-x11-0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xinerama0 libxcb-xfixes0
Expand All @@ -104,7 +104,6 @@ jobs:
pytest tests -k 'not exclude_from_linux_pip_test'
# Windows specific values
- os: windows-2022
pyver: 3.7
venv_cmd: .\venv\Scripts\activate

steps:
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/build_manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ jobs:
include:
# Use this condarc as default
- condarc: .conda/condarc.yaml
- pyver: "3.7"
# Use special condarc if macos
- os: "macos-14"
condarc: .conda_mac/condarc.yaml
pyver: "3.9"
steps:
# Setup
- uses: actions/checkout@v2
Expand All @@ -40,20 +42,24 @@ jobs:
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment_build.yml', 'requirements.txt') }}

- name: Setup Miniconda
# https://github.com/conda-incubator/setup-miniconda
uses: conda-incubator/[email protected]
uses: conda-incubator/[email protected]
with:
python-version: 3.7
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
environment-file: environment_build.yml
miniforge-version: latest
condarc-file: ${{ matrix.condarc }}
environment-file: environment_build.yml
activate-environment: sleap_ci
python-version: ${{ matrix.pyver }}
conda-solver: "libmamba"
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!

- name: Print environment info
shell: bash -l {0}
run: |
which python
conda info
conda list
# Build pip wheel (Not Windows)
- name: Build pip wheel (Not Windows)
Expand Down
64 changes: 23 additions & 41 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,20 @@ on:
- "environment_no_cuda.yml"
- "requirements.txt"
- "dev_requirements.txt"
push:
branches:
- master
- develop
paths:
- "sleap/**"
- "tests/**"
- ".github/workflows/ci.yml"
- "environment_no_cuda.yml"
- "requirements.txt"
- "dev_requirements.txt"
# push:
# branches:
# - main
# - develop
# paths:
# - "sleap/**"
# - "tests/**"
# - ".github/workflows/ci.yml"
# - "environment_no_cuda.yml"
# - "requirements.txt"
# - "dev_requirements.txt"

jobs:
type_check:
name: Type Check
runs-on: "ubuntu-22.04"
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Set up Python 3.7
uses: actions/setup-python@v4
with:
python-version: 3.7
- name: Install Dependencies
run: |
pip install mypy
- name: Run MyPy
# TODO: remove this once all MyPy errors get fixed
continue-on-error: true
run: |
mypy --follow-imports=skip --ignore-missing-imports sleap tests
# Lint
lint:
name: Lint
runs-on: "ubuntu-22.04"
Expand All @@ -59,6 +42,8 @@ jobs:
- name: Run Black
run: |
black --check sleap tests
# Tests
tests:
name: Tests (${{ matrix.os }})
runs-on: ${{ matrix.os }}
Expand All @@ -80,25 +65,22 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v3

- name: Setup Micromamba
# https://github.com/mamba-org/setup-micromamba
uses: mamba-org/setup-micromamba@v1
- name: Setup Conda
uses: conda-incubator/[email protected]
with:
micromamba-version: '1.4.6-0'
miniforge-version: latest
conda-solver: "libmamba"
environment-file: ${{ matrix.env_file }}
environment-name: sleap_ci
init-shell: >-
bash
powershell
post-cleanup: all
activate-environment: sleap_ci
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!

# Print environment info
- name: Print environment info
shell: bash -l {0}
run: |
which python
micromamba info
micromamba list
conda info
conda list
pip freeze
# Test environment
Expand All @@ -109,7 +91,7 @@ jobs:
# Upload coverage
- name: Upload coverage
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v4
if: matrix.os == 'ubuntu-22.04'
with:
token: ${{ secrets.CODECOV_TOKEN }}
Expand Down

0 comments on commit 1ace179

Please sign in to comment.