SciJava projects use Github Actions in a variety of ways:
- Perform builds of SciJava projects. Github Actions deploy
SNAPSHOTbuilds to the SciJava Maven repository in response to pushes to each code repository’s
masterbranch. So any downstream projects depending on a version of
LATESTfor a given component will match the last successful Github build—i.e., the latest code on
- Run each project’s associated unit tests. Github Actions is instrumental in early detection of new bugs introduced to the codebase.
- Perform releases of SciJava projects. Github Actions deploys release builds to the appropriate Maven repository—typically either the SciJava Maven repository or OSS Sonatype.
- Keep the javadoc site updated.
- Keep other web resources updated.
Automatic Deployment of Maven Artifacts
- Host your open-source project on GitHub.
- Contact an ImageJ admin in Gitter or the Image.sc Forum and request that they add the authentication secrets for deployment to your organization.
- In order to add Github CI support to a repository, the secrets are needed: A) for deploying to Maven repositories; and B) in the case of deploying to OSS Sonatype, for GPG signing of artifacts.
- If the secrets have been added to your organization, and you have push access to the relevant repository on GitHub, you can use the github-actionify.sh script with the -f flag to perform the needed operations.
- The github-actionify script will return ‘[ERROR] Dirty working copy’ if you have uncommited changes. If you get this error, check the status of the repository with
git statusand then run
- If you need help, please ask on the Image.sc Forum in the Development category, or in the scijava-common channel on Gitter.
Configuration of JavaFX builds
- The workflows setup by the github-actionify.sh script do not include JavaFX.
- To add support for JavaFX edit the files contained in the folder
.github/workflows/to match those found in other SciJava projects that depend on JavaFX, e.g. FilamentDetector.
Testing things which cannot run headless
before_script: - "export DISPLAY=:99.0" - "sh -e /etc/init.d/xvfb start" - sleep 3 # give xvfb some time to start
Of course, you should do this only as a last resort, since the best unit tests should not require a display in the first place.