Skip to content

Commit 256f96e

Browse files
Major CI cleanup (#293)
* Major CI cleanup * . * . * . * updates from other pr * . * add aarch64, ppc64le * . * fix no-test * add 3.11 tests for windows and macos * disable doctest for windows * don't build for aarch64 in PRs * . * fix bad merge conflict --------- Co-authored-by: Marc-Antoine Schmidt <[email protected]>
1 parent 954b306 commit 256f96e

25 files changed

+189
-550
lines changed

.github/actions/conda-build/action.yml

-14
This file was deleted.

.github/actions/linter/action.yml

-10
This file was deleted.

.github/actions/unittests/action.yml

-23
This file was deleted.

.github/dependabot.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
version: 2
22
updates:
3-
- package-ecosystem: "github-actions"
4-
directory: "/"
3+
- package-ecosystem: github-actions
4+
directory: /
55
schedule:
6-
interval: "weekly"
6+
interval: weekly
77
reviewers:
8-
- "quantco/ci"
8+
- quantco/ci

.github/workflows/base.sh

-9
This file was deleted.

.github/workflows/build_wheels_release.yml renamed to .github/workflows/build-wheels.yml

+16-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: Build and upload to PyPI
22

33
on:
4+
pull_request:
45
release:
56
types:
67
- published
@@ -20,15 +21,25 @@ jobs:
2021
uses: docker/setup-qemu-action@v2
2122
with:
2223
platforms: all
24+
2325
- name: Set up micromamba
2426
uses: mamba-org/setup-micromamba@d05808540d968a55ca33c798e0661fb98f533c73
27+
2528
- name: Build wheels
29+
if: github.event_name != 'release'
2630
uses: pypa/[email protected]
2731
env:
28-
CIBW_ARCHS_LINUX: auto aarch64
32+
CIBW_ARCHS_LINUX: auto
33+
CIBW_ARCHS_MACOS: x86_64 arm64
34+
CIBW_TEST_SKIP: '*-macosx_arm64'
35+
36+
- name: Build wheels (release)
37+
if: github.event_name == 'release' && github.event.action == 'published'
38+
uses: pypa/[email protected]
39+
env:
40+
CIBW_ARCHS_LINUX: aarch64 aarch64
2941
CIBW_ARCHS_MACOS: x86_64 arm64
3042
CIBW_TEST_SKIP: '*-macosx_arm64'
31-
3243
- uses: actions/upload-artifact@v3
3344
with:
3445
path: ./wheelhouse/*.whl
@@ -55,6 +66,7 @@ jobs:
5566
path: dist/*.tar.gz
5667

5768
upload_testpypi:
69+
if: github.event_name == 'release' && github.event.action == 'published'
5870
needs: [build_wheels, build_sdist]
5971
runs-on: ubuntu-latest
6072
steps:
@@ -67,9 +79,10 @@ jobs:
6779
with:
6880
user: __token__
6981
password: ${{ secrets.GH_TESTPYPI_UPLOAD }}
70-
repository_url: https://test.pypi.org/legacy/
82+
repository-url: https://test.pypi.org/legacy/
7183

7284
upload_pypi:
85+
if: github.event_name == 'release' && github.event.action == 'published'
7386
needs: [build_wheels, build_sdist, upload_testpypi]
7487
runs-on: ubuntu-latest
7588
steps:

.github/workflows/build_wheels.yml

-54
This file was deleted.

.github/workflows/ci.yml

+64-51
Original file line numberDiff line numberDiff line change
@@ -2,64 +2,77 @@ name: CI
22
on: [push]
33

44
jobs:
5-
linter:
6-
name: "Linter (pre-commit)"
5+
pre-commit-checks:
6+
name: pre-commit checks
7+
timeout-minutes: 30
78
runs-on: ubuntu-latest
89
env:
9-
CI: True
10-
strategy:
11-
fail-fast: true
12-
steps:
13-
- name: Pull image
14-
run: docker pull condaforge/mambaforge:latest
15-
- name: Checkout branch
16-
uses: actions/checkout@v3
17-
with:
18-
ref: ${{ github.head_ref }}
19-
- name: Run linter inside of container
20-
uses: ./.github/actions/linter
21-
linux:
22-
name: "Linux - tests - Py${{ matrix.PYTHON_VERSION }}"
23-
runs-on: ubuntu-latest
24-
env:
25-
CI: True
26-
strategy:
27-
fail-fast: true
28-
matrix:
29-
PYTHON_VERSION: ['3.7', '3.8', '3.9', '3.10']
10+
PRE_COMMIT_USE_MICROMAMBA: 1
3011
steps:
31-
- name: Pull image
32-
run: docker pull condaforge/mambaforge:latest
33-
- name: Checkout branch
34-
uses: actions/checkout@v3
35-
with:
36-
ref: ${{ github.head_ref }}
37-
- name: Run CI inside of container
38-
uses: ./.github/actions/unittests
39-
with:
40-
python_version: ${{ matrix.PYTHON_VERSION }}
41-
linux-conda-build:
42-
name: "Linux - conda-build - Python ${{ matrix.CONDA_BUILD_YML }}"
43-
runs-on: ubuntu-latest
44-
env:
45-
CI: True
12+
- name: Checkout branch
13+
uses: actions/checkout@v3
14+
- name: Set up micromamba
15+
uses: mamba-org/setup-micromamba@d05808540d968a55ca33c798e0661fb98f533c73
16+
- name: Add micromamba to GITHUB_PATH
17+
run: echo "${HOME}/micromamba-bin" >> "$GITHUB_PATH"
18+
- name: Install Python 3.10
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: "3.10"
22+
- name: Run pre-commit checks
23+
uses: pre-commit/[email protected]
24+
25+
unit-tests:
26+
name: Tests - ${{ matrix.os }} - Py${{ matrix.python-version }}
27+
runs-on: ${{ matrix.os }}
4628
strategy:
4729
fail-fast: true
4830
matrix:
49-
CONDA_BUILD_YML:
50-
- linux_64_python3.7_default.____cpython
51-
- linux_aarch64_python3.10_default.____cpython
52-
- linux_ppc64le_python3.10_default.____cpython
31+
include:
32+
- { os: ubuntu-latest, python-version: '3.7' }
33+
- { os: ubuntu-latest, python-version: '3.8' }
34+
- { os: ubuntu-latest, python-version: '3.9' }
35+
- { os: ubuntu-latest, python-version: '3.10' }
36+
- { os: ubuntu-latest, python-version: '3.11' }
37+
- { os: macos-latest, python-version: '3.7' }
38+
- { os: macos-latest, python-version: '3.11' }
39+
- { os: windows-latest, python-version: '3.7' }
40+
- { os: windows-latest, python-version: '3.11' }
5341
steps:
54-
- name: Pull image
55-
run: docker pull condaforge/mambaforge:latest
5642
- name: Checkout branch
5743
uses: actions/checkout@v3
44+
- name: Set up conda env
45+
uses: mamba-org/setup-micromamba@875557da4ee020f18df03b8910a42203fbf02da1
5846
with:
59-
ref: ${{ github.head_ref }}
60-
- name: Fetch full git history
61-
run: git fetch --prune --unshallow
62-
- name: Run CI inside of container
63-
uses: ./.github/actions/conda-build
64-
with:
65-
conda_build_yml: ${{ matrix.CONDA_BUILD_YML }}
47+
environment-file: ${{ matrix.os == 'windows-latest' && 'environment-win.yml' || 'environment.yml' }}
48+
init-shell: ${{ matrix.os == 'windows-latest' && 'powershell' || 'bash' }}
49+
cache-environment: true
50+
create-args: >-
51+
python=${{ matrix.python-version }}
52+
- name: Install repository (unix)
53+
if: matrix.os != 'windows-latest'
54+
shell: bash -el {0}
55+
run: pip install --no-use-pep517 --no-deps --disable-pip-version-check -e .
56+
- name: Install repository (windows)
57+
if: matrix.os == 'windows-latest'
58+
shell: powershell
59+
run: pip install --no-use-pep517 --no-deps --disable-pip-version-check -e .
60+
- name: Run pytest (unix)
61+
if: matrix.os != 'windows-latest'
62+
shell: bash -el {0}
63+
run: pytest -nauto tests -m "not high_memory" --doctest-modules src/
64+
- name: Run pytest (windows)
65+
if: matrix.os == 'windows-latest'
66+
shell: powershell
67+
run: pytest -nauto tests -m "not high_memory"
68+
- name: Run doctest
69+
if: matrix.os != 'windows-latest'
70+
shell: bash -el {0}
71+
# Check that the readme example will work by running via doctest.
72+
# We run outside the repo to make the test a bit more similar to
73+
# a user running after installing with conda.
74+
run: |
75+
mkdir ../temp
76+
cp README.md ../temp
77+
cd ../temp
78+
python -m doctest -v README.md

.github/workflows/conda-build-linux-main.yml

-32
This file was deleted.

.github/workflows/conda-build-macos.yml

-36
This file was deleted.

0 commit comments

Comments
 (0)