diff --git a/.github/workflows/pypi-wheel-builds.yml b/.github/workflows/pypi-wheel-builds.yml index 853b64c82..a33c7d412 100644 --- a/.github/workflows/pypi-wheel-builds.yml +++ b/.github/workflows/pypi-wheel-builds.yml @@ -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: @@ -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__ diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index de3d309e5..f591d16eb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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 @@ -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 ] diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9c9dc704c..7db22e917 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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