Merge pull request #121 from feelpp/111-new-file-for-plots #546
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
name: CI | |
on: | |
push: | |
branches: | |
- '**' # Push events on all branches | |
paths-ignore: | |
- '.github/workflows/init.yml' | |
tags: | |
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 including semver | |
pull_request: | |
branches: | |
- '**' # Pull request events on all branches | |
jobs: | |
build_wheel: | |
runs-on: self-ubuntu-22.04 | |
name: Build wheel | |
if: "!contains(github.event.head_commit.message, 'wheel skip')" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Create Virtual Environment | |
run: | | |
python3 -m venv .venv | |
source .venv/bin/activate | |
pip3 install -I -r requirements.txt | |
- name: Compile | |
run: | | |
pip3 wheel --no-deps --wheel-dir dist . | |
env: | |
CXX: clang++ | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: wheel-artifacts | |
path: dist/*.whl | |
generate_reports: | |
runs-on: self-ubuntu-22.04 | |
needs: build_wheel | |
if: github.event_name == 'pull_request' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Create Virtual Environment | |
run: | | |
python3 -m venv .venv | |
source .venv/bin/activate | |
pip3 install -r requirements.txt | |
- name: Download Wheel Packages | |
uses: actions/download-artifact@v3 | |
with: | |
name: wheel-artifacts | |
path: dist/ | |
- name: Install wheel | |
run: | | |
source .venv/bin/activate | |
python3 -m pip install --force-reinstall dist/*.whl | |
- name: Reset reports | |
run: | | |
rm -r ./docs/modules/ROOT/pages/applications/ | |
rm -r ./reports/ | |
- name: Render reports | |
run: | | |
source .venv/bin/activate | |
render-benchmarks | |
env: | |
GIRDER_API_KEY: ${{ secrets.GIRDER }} | |
- name: Push reports | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
with: | |
commit_message: "Update reports" | |
branch: ${{ github.head_ref }} | |
file_pattern: "docs/modules/* reports/**/*.json" | |
docs: | |
runs-on: self-ubuntu-22.04 | |
name: Build Antora Site | |
needs: generate_reports | |
if: always() | |
steps: | |
- name: Check if skip | |
if: contains(github.event.head_commit.message, 'docs skip') | |
run: exit 1 | |
- uses: actions/checkout@v4 | |
- name: Install credentials | |
run: echo https://$GITHUB_OAUTH:@github.com > $HOME/.git-credentials | |
env: | |
GITHUB_OAUTH: ${{ secrets.CR_PAT_WORKFLOW }} | |
- name: Install NPM dependencies | |
run: npm install | |
- name: Download | |
uses: actions/download-artifact@v3 | |
with: | |
name: wheel-artifacts | |
path: dist/ | |
- name: Install Python dependencies | |
run: | | |
python -m venv .venv | |
source .venv/bin/activate | |
pip3 install -I -r requirements.txt | |
pip3 install dist/*.whl | |
tree .venv | |
- name: Build Antora Site | |
run: | | |
source .venv/bin/activate | |
npm run antora | |
- name: Deploy | |
if: ${{ github.ref_name == 'master' }} | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
branch: gh-pages # The branch the action should deploy to. | |
folder: public # The folder the action should deploy. | |
build_code: | |
runs-on: self-ubuntu-22.04 | |
name: Build, Install, Package code | |
if: "!contains(github.event.head_commit.message, 'code skip')" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Build | |
run: | | |
cmake --preset default | |
cmake --build --preset default | |
- name: Check | |
run: | | |
ctest --preset default | |
env: | |
OMPI_ALLOW_RUN_AS_ROOT: 1 | |
OMPI_ALLOW_RUN_AS_ROOT_CONFIRM: 1 | |
- name: Package | |
run: | | |
cmake --build --preset default -t package | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: benchmarking-artifacts | |
path: build/default/assets/benchmarking-* | |
deliver: | |
runs-on: self-ubuntu-22.04 | |
needs: build_code | |
name: Build docker, tag and push | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download | |
uses: actions/download-artifact@v3 | |
with: | |
# Artifact name | |
name: benchmarking-artifacts | |
path: artifacts/ | |
- name: Docker meta | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: | | |
ghcr.io/feelpp/benchmarking | |
tags: | | |
type=ref,event=branch | |
type=ref,event=pr | |
type=semver,pattern={{version}} | |
type=semver,pattern={{major}}.{{minor}} | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.CR_PAT }} | |
- name: Build container image | |
uses: docker/build-push-action@v6 | |
with: | |
context: artifacts | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
file: ./Dockerfile | |
release: | |
runs-on: self-ubuntu-22.04 | |
name: Release | |
needs: [build_wheel, build_code] | |
if: startsWith(github.ref ,'refs/tags/v') | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download Deb Packages | |
uses: actions/download-artifact@v3 | |
with: | |
name: benchmarking-artifacts | |
path: artifacts/ | |
- name: Download Wheel Packages | |
uses: actions/download-artifact@v3 | |
with: | |
name: wheel-artifacts | |
path: dist/ | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
artifacts/*.deb | |
dist/*.whl | |
draft: false | |
prerelease: ${{ contains(github.ref, 'alpha') || contains(github.ref, 'beta') || contains(github.ref, 'rc')}} | |
name: Release ${{ github.ref_name }} | |
generate_release_notes: true | |
tag_name: ${{ github.ref }} | |
token: ${{ secrets.GITHUB_TOKEN }} |