Skip to content

Commit

Permalink
Parametrize GitHub workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
aradi committed Oct 18, 2024
1 parent 5cbaa9a commit ab41a3c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 20 deletions.
38 changes: 21 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ on:
branches: [main]
workflow_dispatch:

env:
BUILD_DIR: _build
INSTALL_DIR: _install
FPM_EXPORT_DIR: _fpm_export

jobs:

#
# Test Fortuno in various system configurations
# Build and test Fortuno in various system configurations
#
fortuno-test:
build-and-test:

runs-on: ${{ matrix.os }}
env:
BUILD_DIR: _build
INSTALL_DIR: _install
FPM_EXPORT_DIR: _fpm_export
strategy:
fail-fast: false
matrix:
Expand Down Expand Up @@ -208,11 +208,15 @@ jobs:
${RUN_PREFIX} ${BUILD_DIR}/testapp_fpp
rm -rf subprojects ${BUILD_DIR}
deploy-fpm:
needs: fortuno-test
deploy-fpm-repos:
needs: build-and-test
if: github.repository == 'fortuno-repos/fortuno' && github.event_name == 'push' && github.ref == 'refs/heads/main'

runs-on: ubuntu-latest
env:
DEPLOYMENT_KEY_PREFIX: DEPLOY_KEY
DEPLOYMENT_TARGET_REPO_PREFIX: fortuno-fpm

steps:

Expand All @@ -225,11 +229,11 @@ jobs:
- name: Push to serial repository
uses: cpina/github-action-push-to-another-repository@main
env:
SSH_DEPLOY_KEY: ${{ secrets.DEPLOY_KEY_FORTUNO_FPM_SERIAL }}
SSH_DEPLOY_KEY: ${{ secrets[format('{0}_FORTUNO_FPM_SERIAL', env.DEPLOYMENT_KEY_PREFIX)] }}
with:
source-directory: _fpm_serial
destination-github-username: 'fortuno-repos'
destination-repository-name: 'fortuno-fpm-serial'
destination-github-username: fortuno-repos
destination-repository-name: ${{ format('{0}-serial', env.DEPLOYMENT_TARGET_REPO_PREFIX) }}
user-email: aradi@uni-bremen.de
target-branch: main

Expand All @@ -239,11 +243,11 @@ jobs:
- name: Push to mpi repository
uses: cpina/github-action-push-to-another-repository@main
env:
SSH_DEPLOY_KEY: ${{ secrets.DEPLOY_KEY_FORTUNO_FPM_MPI }}
SSH_DEPLOY_KEY: ${{ secrets[format('{0}_FORTUNO_FPM_MPI', env.DEPLOYMENT_KEY_PREFIX)] }}
with:
source-directory: _fpm_mpi
destination-github-username: 'fortuno-repos'
destination-repository-name: 'fortuno-fpm-mpi'
destination-github-username: fortuno-repos
destination-repository-name: ${{ format('{0}-mpi', env.DEPLOYMENT_TARGET_REPO_PREFIX) }}
user-email: aradi@uni-bremen.de
target-branch: main

Expand All @@ -253,10 +257,10 @@ jobs:
- name: Push to coarray repository
uses: cpina/github-action-push-to-another-repository@main
env:
SSH_DEPLOY_KEY: ${{ secrets.DEPLOY_KEY_FORTUNO_FPM_COARRAY }}
SSH_DEPLOY_KEY: ${{ secrets[format('{0}_FORTUNO_FPM_COARRAY', env.DEPLOYMENT_KEY_PREFIX)] }}
with:
source-directory: _fpm_coarray
destination-github-username: 'fortuno-repos'
destination-repository-name: 'fortuno-fpm-coarray'
destination-github-username: fortuno-repos
destination-repository-name: ${{ format('{0}-coarray', env.DEPLOYMENT_TARGET_REPO_PREFIX) }}
user-email: aradi@uni-bremen.de
target-branch: main
6 changes: 3 additions & 3 deletions devel/fpm-repo/common/addons/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
Fortuno – flextensible unit testing framework for Fortran
*********************************************************

**Note**: This repository is automatically generated and deployed by the
`Fortuno project <https://github.com/fortuno-repos/fortuno>`_. Please direct
any pull requests, issues, or other contributions to the `primary repository
This repository is automatically generated and deployed by the `Fortuno
project <https://github.com/fortuno-repos/fortuno>`_. Please direct any pull
requests, issues, or other contributions to the `primary repository
<https://github.com/fortuno-repos/fortuno>`_.

**Fortuno** (Fortran Unit Testing Objects) is a flexible & extensible,
Expand Down

0 comments on commit ab41a3c

Please sign in to comment.