Skip to content

Commit

Permalink
Add runners for all toolchains
Browse files Browse the repository at this point in the history
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
  • Loading branch information
LecrisUT committed Feb 22, 2023
1 parent ebdf413 commit 91c8af3
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 21 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/pypi-wheel-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
path: dist/*.tar.gz

upload_pypi:
name: Upload to pypi repository
needs: [ build_wheels, build_sdist ]
runs-on: ubuntu-latest
steps:
Expand All @@ -53,14 +54,14 @@ jobs:
name: artifact
path: dist
- name: Publish package to TestPyPI
if: ${{ contains(github.ref, 'rc') }}
if: ${{ !contains(github.ref, 'test') && contains(github.ref, 'rc') }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Publish package to PyPI
if: ${{ !contains(github.ref, 'rc') }}
if: ${{ !contains(github.ref, 'test') && !contains(github.ref, 'rc') }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
Expand Down
52 changes: 33 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,42 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: pre-commit/action@v3.0.0

ctest-linux:
runs-on: ubuntu-latest
needs: [ pre-commit ]
strategy:
matrix:
toolchain: [ gcc, intel, llvm ]

steps:
- name: Add Intel compiler repository
run: |
cd /tmp
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main"
if: ${{ matrix.toolchain == "intel" }}
- name: Install intel compiler
shell: bash
run: |
sudo apt install -y intel-basekit intel-oneapi-compiler-fortran
if: ${{ matrix.toolchain == "intel" }}
- name: Install LLVM compilers
run: |
sudo apt install -y clang
if: ${{ matrix.toolchain == "llvm" }}
- uses: actions/checkout@v3
- uses: lukka/get-cmake@latest
- name: Run CMake configuration ${{ matrix.toolchain }}
uses: lukka/run-cmake@v10
with:
workflowPreset: "${{ matrix.toolchain }}-ci"

pytest-linux:
runs-on: ubuntu-latest
needs: [ ctest-linux ]
strategy:
fail-fast: true

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -47,23 +78,6 @@ jobs:
with:
verbose: true

ctest-linux:
runs-on: ubuntu-latest
needs: [ pre-commit ]

steps:
- uses: actions/checkout@v3
- uses: lukka/get-cmake@latest
# TODO: switch to cmake preset file
- name: Build
run: |
cmake -S . -B build -DSPGLIB_USE_SANITIZER="Address" -DSPGLIB_WITH_TESTS=ON -DSPGLIB_WITH_Fortran=ON
cmake --build build
- name: Test
working-directory: build/test
run: |
ctest
docs:
runs-on: ubuntu-latest
needs: [ ctest-linux, pytest-linux ]
Expand Down
4 changes: 4 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,7 @@ repos:
additional_dependencies:
- mdformat-gfm
- mdformat-tables
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.21.0
hooks:
- id: check-github-workflows

0 comments on commit 91c8af3

Please sign in to comment.