Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unit test on GitHub actions and test with numpy 2.0. #56

Merged
merged 5 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 0 additions & 130 deletions .circleci/config.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .circleci/oldest-test-reqs.txt

This file was deleted.

61 changes: 61 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: PyPI

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
pull_request:

push:
branches:
- "trunk-*"
tags:
- "v*"

workflow_dispatch:

jobs:
build_wheel:
name: Build wheel
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- name: Set up Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: 3.12
- name: Set up Python environment
uses: glotzerlab/workflows/setup-uv@5cfac9da9cb78e16ae97a9119b6fd13c1c2d6f5e # 0.1.0
with:
lockfile: ".github/workflows/requirements-build.txt"

- name: Build wheel
run: python3 -m build --outdir dist/ .

- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: dist
path: dist

upload_pypi:
name: Publish [PyPI]
needs: [build_wheel]
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Download artifacts
uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
with:
merge-multiple: 'true'
pattern: dist
path: dist

- name: Check files
run: ls -lR dist

- name: Upload to PyPI
if: startsWith(github.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@ec4db0b4ddc65acdf4bff5fa45ac92d78b56bdf0 # v1.9.0
1 change: 1 addition & 0 deletions .github/workflows/requirements-build.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build == 1.1.1
8 changes: 8 additions & 0 deletions .github/workflows/requirements-build.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file was autogenerated by uv via the following command:
# uv pip compile requirements-build.in
build==1.1.1
# via -r requirements-build.in
packaging==24.1
# via build
pyproject-hooks==1.1.0
# via build
5 changes: 5 additions & 0 deletions .github/workflows/requirements-test.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
coverage == 7.5.3
numpy == 2.0.0
pytest == 8.2.2
pytest-cov == 5.0.0
scipy == 1.13.1
30 changes: 30 additions & 0 deletions .github/workflows/requirements-test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This file was autogenerated by uv via the following command:
# uv pip compile requirements-test.in --python-version 3.9 --python-platform linux --no-build
coverage==7.5.3
# via
# -r requirements-test.in
# pytest-cov
exceptiongroup==1.2.1
# via pytest
iniconfig==2.0.0
# via pytest
numpy==2.0.0
# via
# -r requirements-test.in
# scipy
packaging==24.1
# via pytest
pluggy==1.5.0
# via pytest
pytest==8.2.2
# via
# -r requirements-test.in
# pytest-cov
pytest-cov==5.0.0
# via -r requirements-test.in
scipy==1.13.1
# via -r requirements-test.in
tomli==2.0.1
# via
# coverage
# pytest
53 changes: 53 additions & 0 deletions .github/workflows/unit_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Unit test

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
pull_request:

push:
branches:
- "master"

workflow_dispatch:

defaults:
run:
shell: bash

jobs:
unit_test:
name: Unit test [py${{ matrix.python }}]
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
python: ["3.9", "3.10", "3.11", "3.12"]

steps:
- name: Checkout
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
- name: Set up Python
uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
with:
python-version: ${{ matrix.python }}
- name: Set up Python environment
uses: glotzerlab/workflows/setup-uv@5cfac9da9cb78e16ae97a9119b6fd13c1c2d6f5e # 0.1.0
with:
lockfile: ".github/workflows/requirements-test.txt"
- name: Run tests
run: python3 -m pytest -v

# This job is used to provide a single requirement for branch merge conditions.
tests_complete:
name: Unit test
if: always()
needs: [unit_test]
runs-on: ubuntu-latest

steps:
- run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
- name: Done
run: exit 0
5 changes: 0 additions & 5 deletions requirements/requirements-testing.txt

This file was deleted.