Skip to content

Commit

Permalink
Merge pull request #1465 from timfelle/cicd/flint_badge
Browse files Browse the repository at this point in the history
Move badge creation to checks
  • Loading branch information
njansson authored Sep 17, 2024
2 parents 39c2ecb + b1c54d0 commit 2969cdb
Show file tree
Hide file tree
Showing 7 changed files with 121 additions and 222 deletions.
22 changes: 19 additions & 3 deletions .github/workflows/check_gnu.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: GNU Matrix
name: GNU Fortran

# Controls when the action will run.
on:
push:
branches:
- develop

workflow_call:
inputs:
json-fortran-version:
Expand Down Expand Up @@ -78,20 +82,32 @@ jobs:
id: setup-env
run: ${{ matrix.setup-env }}

- name: Setup dependencies
id: setup-deps
env:
PFUNIT_VERSION: ${{ inputs.pfunit-version }}
JSON_FORTRAN_VERSION: ${{ inputs.json-fortran-version }}
run: |
if [ -z "$PFUNIT_VERSION" ]; then PFUNIT_VERSION="v4.4.2"; fi
if [ -z "$JSON_FORTRAN_VERSION" ]; then JSON_FORTRAN_VERSION="8.3.0"; fi
echo "pfunit-version=$PFUNIT_VERSION" >> $GITHUB_OUTPUT
echo "json-fortran-version=$JSON_FORTRAN_VERSION" >> $GITHUB_OUTPUT
- name: Get pFunit
id: get-pfunit
if: matrix.backend == 'cpu'
uses: ./.github/actions/setup_pfunit
with:
version: ${{ inputs.pfunit-version }}
version: ${{ steps.setup-deps.outputs.pfunit-version }}
os: ${{ steps.setup-env.outputs.os-version }}
compiler: ${{ matrix.compiler }}

- name: Get json-fortran
id: get-json-fortran
uses: ./.github/actions/setup_json-fortran
with:
version: ${{ inputs.json-fortran-version }}
version: ${{ steps.setup-deps.outputs.json-fortran-version }}
os: ${{ steps.setup-env.outputs.os-version }}
compiler: ${{ matrix.compiler }}

Expand Down
17 changes: 15 additions & 2 deletions .github/workflows/check_intel.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: Intel Matrix
name: Intel Fortran

# Controls when the action will run.
on:
push:
branches:
- develop

workflow_call:
inputs:
json-fortran-version:
Expand Down Expand Up @@ -49,11 +53,20 @@ jobs:
with:
fetch-depth: 1

- name: Setup dependencies
id: setup-deps
env:
JSON_FORTRAN_VERSION: ${{ inputs.json-fortran-version }}
run: |
if [ -z "$JSON_FORTRAN_VERSION" ]; then JSON_FORTRAN_VERSION="8.3.0"; fi
echo "json-fortran-version=$JSON_FORTRAN_VERSION" >> $GITHUB_OUTPUT
- name: Get JSON-Fortran
id: get-json-fortran
uses: ./.github/actions/setup_json-fortran
with:
version: ${{ inputs.json-fortran-version }}
version: ${{ steps.setup-deps.outputs.json-fortran-version }}
os: ${{ steps.setup-env.outputs.os-version }}
compiler: ${{ matrix.compiler }}

Expand Down
29 changes: 29 additions & 0 deletions .github/workflows/check_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,3 +182,32 @@ jobs:
fi
fi
# Create a badge for the flint score
create-badge-lint:
name: "Create linting badge"
runs-on: ubuntu-20.04
needs:
- lint-current

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup env.
run: |
sudo apt-get update
sudo apt-get install -yq python3-pip
pip install anybadge
- name: Create badge
env:
score: ${{ needs.lint-current.outputs.score }}
run: |
mkdir -p doc/media
anybadge -l Flint -o --file=doc/media/lint-badge.svg -v $score 9.0=red 9.9=yellow 10=green
- name: Save artifact
uses: actions/upload-artifact@v4
with:
name: lint-badge
path: doc/media/lint-badge.svg
16 changes: 14 additions & 2 deletions .github/workflows/check_nvidia.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: NVIDIA Matrix
name: NVIDIA Fortran

# Controls when the action will run.
on:
push:
branches:
- develop

workflow_call:
inputs:
json-fortran-version:
Expand Down Expand Up @@ -58,11 +62,19 @@ jobs:
with:
fetch-depth: 1

- name: Setup dependencies
id: setup-deps
env:
JSON_FORTRAN_VERSION: ${{ inputs.json-fortran-version }}
run: |
if [ -z "$JSON_FORTRAN_VERSION" ]; then JSON_FORTRAN_VERSION="8.3.0"; fi
echo "json-fortran-version=$JSON_FORTRAN_VERSION" >> $GITHUB_OUTPUT
- name: Get JSON-Fortran
id: get-json-fortran
uses: ./.github/actions/setup_json-fortran
with:
version: ${{ inputs.json-fortran-version }}
version: ${{ steps.setup-deps.outputs.json-fortran-version }}
os: ${{ steps.setup-env.outputs.os-version }}
compiler: ${{ matrix.compiler }}

Expand Down
45 changes: 41 additions & 4 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ jobs:
with:
json-fortran-version: ${{ needs.prepare.outputs.json-fortran-version }}

# ========================================================================== #
# Compilation checks

GNU:
name: GNU
needs:
Expand All @@ -80,15 +83,18 @@ jobs:
with:
json-fortran-version: ${{ needs.prepare.outputs.json-fortran-version }}

NVIDIA:
name: NVIDIA
Nvidia:
name: Nvidia
needs:
- prepare
- depend
uses: ./.github/workflows/check_nvidia.yml
with:
json-fortran-version: ${{ needs.prepare.outputs.json-fortran-version }}

# ========================================================================== #
# ReFrame and bencharks

ReFrame:
name: ReFrame
needs:
Expand All @@ -99,6 +105,37 @@ jobs:
with:
json-fortran-version: ${{ needs.prepare.outputs.json-fortran-version }}

# # ========================================================================== #
# # Upload the badges

# upload-badges:
# name: "Upload badges"
# runs-on: ubuntu-20.04
# needs:
# - linting

# if: ${{ !cancelled() }} &&
# ${{ needs.linting.result == 'success' }} &&

# steps:
# - name: Checkout
# uses: actions/checkout@v4

# - name: Download artifacts
# uses: actions/download-artifact@v4
# with:
# pattern: "*-badge"
# path: doc/media/
# merge-multiple: true

# - name: Push badges
# uses: EndBug/add-and-commit@v9
# with:
# add: "doc/media/*-badge.svg"
# message: "Add badges"
# author_name: "GitHub Actions"
# default_author: github_actor

check_complete:
name: Develop PR Ready
if: ${{ always() }}
Expand All @@ -108,15 +145,15 @@ jobs:
- depend
- GNU
- Intel
- NVIDIA
- Nvidia
- ReFrame
runs-on: ubuntu-latest
env:
draft_status: ${{ needs.prepare.result }}
flint_status: ${{ needs.linting.result }}
gnu_status: ${{ needs.GNU.result }}
inel_status: ${{ needs.Intel.result }}
nvidia_status: ${{ needs.NVIDIA.result }}
nvidia_status: ${{ needs.Nvidia.result }}
reframe_status: ${{ needs.ReFrame.result }}

steps:
Expand Down
Loading

0 comments on commit 2969cdb

Please sign in to comment.