Skip to content

Latest commit

History

51 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

github-workflows

Reusable github workflows for FAIRDataTeam repositories.

General info

For more info about reusing workflows, see sharing automations documentation, specifically:

Dependent repos

The following FAIRDataTeam repositories depend on the reusable workflows from this repo:

Examples

maven-publish

An example of a publication workflow that is triggered when a release is created, and re-uses two workflows:

name: Maven publishon:
release:
types: [created]jobs:
test:
uses: FAIRDataTeam/github-workflows/.github/workflows/maven-verify.yml@v2publish:
needs: testuses: FAIRDataTeam/github-workflows/.github/workflows/maven-publish.yml@v2secrets: inherit

It is also possible to specify additional options for the maven-verify workflow, for example:

jobs:
test:
uses: FAIRDataTeam/github-workflows/.github/workflows/maven-verify.yml@v2with:
mvn_options: -Dgpg.skip tidy:check com.github.spotbugs:spotbugs-maven-plugin:check

maven-verify with database

The maven-verify workflow also supports optional database setup. For example:

jobs:
test:
uses: FAIRDataTeam/github-workflows/.github/workflows/maven-verify.yml@v2with:
# the double quotes are required for windows runnersmvn-options: '-D"spring.profiles.active"=testing'# db settings must match those defined in the spring profiledb-type: postgresqldb-version: 17db-name: fdp_testdb-username: fdpdb-password: fdpdb-port: 54321

docker-publish

For pull requests, nothing is uploaded, but a test build is created.

The following variables and secrets must be defined in the calling repo (conforming to existing names from the FDP repos):

  • vars.DOCKER_IMAGE_NAME
  • vars.DOCKER_HUB_USERNAME
  • secrets.DOCKER_HUB_PASSWORD

Secrets must be inherited from the caller.

The workflow could be triggered on push and pull_request (see [1]). For example:

name: publish to docker hub on pushon:
push:
branches:
- developpull_request:
jobs:
publish:
uses: FAIRDataTeam/github-workflows/.github/workflows/docker-publish.yml@v2secrets: inheritwith:
push: ${{ github.event_name != 'pull_request' }}

Alternatively, we could push on release creation only, for example:

name: publish to docker hub on releaseon:
release:
types: [created]jobs:
publish:
uses: FAIRDataTeam/github-workflows/.github/workflows/docker-publish.yml@v2secrets: inheritwith:
push: ${{ github.event_name == 'release' && github.event.action == 'created' }}

Releases

Releases follow semantic versioning. To get the latest stable release you can refer to the major version only, e.g. v2 instead of v2.3.4. Also see action versioning.

Note

Contributors, please read the contribution guidelines for instructions w.r.t. releases.

About

Reusable github workflows for FAIRDataTeam repos

Resources

Contributing

Stars

1 star

Watchers

4 watching

Forks

Releases

Packages

Used by

Contributors

Languages