-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from karlosss/improve-cicd
improve cicd
- Loading branch information
Showing
5 changed files
with
37 additions
and
34 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,29 +50,20 @@ jobs: | |
path: dist/*.tar.gz | ||
|
||
build_wheels: | ||
name: Build wheels on ${{ matrix.os }} | ||
name: Build wheels (${{ matrix.os }}) | ||
runs-on: ${{ matrix.os }} | ||
needs: generate_version | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# os: [ubuntu-latest, macos-13, macos-14] currently only works on Linux | ||
os: [ubuntu-latest] | ||
os: [ ubuntu-latest ] | ||
|
||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: 'recursive' | ||
|
||
- name: Download version | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: VERSION | ||
path: . | ||
|
||
- name: Update version | ||
run: sed -i "s/^version.*\$/version = \"$(cat VERSION)\"/g" pyproject.toml | ||
|
||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
|
||
|
@@ -108,9 +99,14 @@ jobs: | |
password: ${{ secrets.TESTPYPI_TOKEN }} | ||
|
||
install_and_run_tests: | ||
name: Install package from Test PyPI and run tests | ||
name: Install package from Test PyPI and run tests (${{ matrix.os }}, ${{ matrix.python-version }}) | ||
runs-on: ${{ matrix.os }} | ||
needs: publish_test | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ ubuntu-latest ] | ||
python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ] | ||
|
||
steps: | ||
- name: Checkout the tests | ||
|
@@ -119,7 +115,7 @@ jobs: | |
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.x" | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Download version | ||
uses: actions/download-artifact@v4 | ||
|
@@ -128,7 +124,7 @@ jobs: | |
path: . | ||
|
||
- name: Wait for package and install it | ||
run: while ! pip install --extra-index-url https://test.pypi.org/simple/ --no-cache-dir swisspair[test]==$(cat VERSION); do sleep 5; done | ||
run: cnt=0; while ! pip install --extra-index-url https://test.pypi.org/simple/ --no-cache-dir swisspair[test]==$(cat VERSION); if [[ $cnt -eq 10 ]]; then echo "Package unavailable"; exit 1; fi; do sleep 5; cnt=$((cnt+1)); done | ||
|
||
- name: Run tests | ||
run: pytest |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ build-backend = "scikit_build_core.build" | |
|
||
[project] | ||
name = "swisspair" | ||
# version is only for local development, it gets set automatically in CI/CD | ||
version = "0.0.13" | ||
author = "Karel Jilek" | ||
author_email = "[email protected]" | ||
|
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