-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
- Loading branch information
Showing
6 changed files
with
184 additions
and
48 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: CI | ||
run-name: > | ||
CI (${{ github.event_name }}) | ||
${{ github.event_name == 'pull_request' && format('PR#{0}', github.event.number) || '' }} | ||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
branches: [ develop ] | ||
push: | ||
branches: [ develop ] | ||
|
||
permissions: | ||
contents: read | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
pre-commit: | ||
name: pre-commit | ||
uses: ./.github/workflows/step_pre-commit.yaml | ||
|
||
tests: | ||
name: test | ||
needs: [ pre-commit ] | ||
uses: ./.github/workflows/step_test.yaml | ||
with: | ||
mask-experimental: ${{ github.event_name == 'push' }} | ||
|
||
tests-makefile: | ||
name: test Makefile | ||
needs: [ pre-commit ] | ||
uses: ./.github/workflows/step_test-makefile.yaml | ||
|
||
docs: | ||
name: 📘 docs | ||
needs: [ pre-commit ] | ||
uses: ./.github/workflows/step_docs.yaml | ||
|
||
pass: | ||
name: ✅ Pass | ||
needs: [ pre-commit, tests, tests-makefile, docs ] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check all CI jobs | ||
uses: re-actors/alls-green@release/v1 | ||
with: | ||
jobs: ${{ toJSON(needs) }} | ||
if: always() |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: 📘 test-docs | ||
|
||
on: | ||
workflow_call: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
docs: | ||
name: Build docs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.11" | ||
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV | ||
- uses: actions/cache@v4 | ||
with: | ||
key: mkdocs-w90-${{ env.cache_id }} | ||
path: .cache | ||
restore-keys: | | ||
mkdocs-w90- | ||
- run: pip install -r docs/requirements.txt | ||
- run: mkdocs build -s | ||
working-directory: ./docs | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
ENABLE_MKDOCS_GIT_COMMITTERS: False | ||
|
||
- name: Deploy to GitHub Pages | ||
uses: peaceiris/actions-gh-pages@v3 | ||
if: github.ref == 'refs/heads/develop' | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
publish_dir: ./docs/site |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: pre-commit | ||
|
||
on: | ||
workflow_call: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
pre-commit: | ||
name: Check pre-commit | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.x | ||
- uses: pre-commit/action@v3.0.0 |
17 changes: 5 additions & 12 deletions
17
.github/workflows/main.yml → .github/workflows/step_test-makefile.yaml
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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: test | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
mask-experimental: | ||
type: boolean | ||
default: true | ||
description: Always report experimental test as successful | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
tests: | ||
name: > | ||
🖥️ ${{ matrix.os || 'Fedora' }} | ||
${{ !matrix.os && format('🛠️ {0}', matrix.toolchain) || '' }} | ||
${{ matrix.mpi && format('🖧 {0}', matrix.mpi) || '' }} | ||
${{ matrix.experimental && '[🧪 Experimental]' || '' }} | ||
runs-on: ${{ matrix.os || 'ubuntu-latest' }} | ||
container: ${{ !matrix.os && 'ghcr.io/lecrisut/dev-env:main' || '' }} | ||
continue-on-error: ${{ matrix.experimental || false }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
toolchain: [ gcc, llvm, intel ] | ||
mpi: [false, openmpi, mpich, intel] | ||
include: | ||
# flang is missing features in 16.0.6 | ||
- toolchain: llvm | ||
experimental: true | ||
steps: | ||
- name: Install missing packages | ||
run: dnf install -y bzip2 python-unversioned-command | ||
- name: Load mpi module ${{ matrix.mpi || '' }} | ||
run: | | ||
# Get interactive profile to be able to load modules | ||
source /etc/profile | ||
# Save the current environment since we only want the added difference | ||
printenv > orig_env | ||
# Load the relevant mpi module | ||
module load mpi/${{ matrix.mpi }} | ||
printenv > module_env | ||
diff orig_env module_env | sed -n 's/> //p' >> $GITHUB_ENV | ||
# Set MPI flag on | ||
echo "WITH_MPI=ON" >> $GITHUB_ENV | ||
if: matrix.mpi | ||
- name: Enable msvc toolchain on windows | ||
uses: ilammy/msvc-dev-cmd@v1 | ||
if: contains(matrix.os, 'windows') | ||
- name: Activate Intel compilers | ||
# Not elegant, it will propagate all environment variable. | ||
# Intel does not provide a way to output the environment variables to a file | ||
# Note: PATH needs to be exported to GITHUB_PATH otherwise it can be overwritten | ||
run: | | ||
source /opt/intel/oneapi/setvars.sh | ||
printenv >> $GITHUB_ENV | ||
echo $PATH >> $GITHUB_PATH | ||
if: matrix.toolchain == 'intel' | ||
- uses: actions/checkout@v3 | ||
- uses: lukka/get-cmake@latest | ||
- name: Run CMake workflow ${{ matrix.toolchain }}-ci | ||
uses: lukka/run-cmake@v10.3 | ||
with: | ||
workflowPreset: "${{ matrix.toolchain }}-ci" | ||
continue-on-error: ${{ matrix.experimental && inputs.mask-experimental}} |