Docker build updates #5591
Workflow file for this run
This file contains hidden or 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
| # CI.yml | |
| # This file contains the script used by GitHub actions to execute the Continuous Integration (CI) | |
| # for RMG-Py. This includes building RMG and its dependencies, executing the unit tests, | |
| # functional tests, database tests, and regression tests. | |
| # | |
| # This will run automatically on any push to any branch, but will only run one instance of | |
| # itself at a time per branch (to avoid spawning tons of runners, which prevents them from | |
| # executing). | |
| # | |
| # In the regression testing section of the action the term "Stable" or "Reference" refers to | |
| # the 'correct answers' to the regression tests, i.e. the way that the main branch executes | |
| # them. These 'answers' are re-generated daily, or on any push to main, and retrieved whenever | |
| # a push is made to a non-main branch. The new proposed changes are referred to as "Dynamic". | |
| # | |
| # | |
| # Changelog: | |
| # 2023-04 - Jackson Burns - Added this header, regression tests, cleanup of action in | |
| # in general, and documentation throughout the file. | |
| # 2023-05 - added Docker build steps | |
| # 2023-05-12 - added changes to allow running on forks | |
| # 2023-06-06 - added matrix build for libstdcxx-ng versions 12 and 13 on ubuntu. Only expect 12 to work. | |
| # 2023-06-07 - updated regression testing. Now fails if significant changes are detected. | |
| # 2023-06-15 - revert changes from 06-06, both now work | |
| # 2023-06-27 - add option to run from RMG-database with GitHub resuable workflows | |
| # 2023-07-17 - made it pass by default | |
| # 2023-07-21 - upload the regression results summary as artifact (for use as a comment on PRs) | |
| # 2023-07-31 - removed option to run from RMG-database with GitHub resuable workflows | |
| # 2024-10-01 - deprecated Mambaforge with Miniforge3 for environment creation | |
| name: Continuous Integration | |
| on: | |
| schedule: | |
| # * is a special character in YAML so you have to quote this string | |
| - cron: "0 8 * * *" | |
| # allow running on RMG-Py on a pushed branch, only if triggered manually | |
| workflow_dispatch: | |
| # runs on PRs against RMG-Py (and anywhere else, but we add this for RMG-Py) | |
| pull_request: | |
| # this prevents one PR from simultaneously running multiple runners, which will clog up the queue | |
| # and prevent other PRs from running the CI | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| # if running on RMG-Py but requiring changes on an un-merged branch of RMG-database, replace | |
| # main with the name of the branch | |
| RMG_DATABASE_BRANCH: main | |
| # julia parallel pre-compilation leads to race conditions and hangs, so we limit it to run in serial | |
| JULIA_NUM_PRECOMPILE_TASKS: 1 | |
| jobs: | |
| build-and-push-docker: | |
| # after testing and on pushes to main, build and push docker image | |
| # | |
| # taken from https://github.com/docker/build-push-action | |
| runs-on: ubuntu-latest | |
| # Run on push to main or on pull requests | |
| if: | | |
| (github.ref == 'refs/heads/main' && github.repository == 'ReactionMechanismGenerator/RMG-Py') || | |
| (github.event_name == 'pull_request') | |
| steps: | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Docker Hub | |
| if: github.ref == 'refs/heads/main' && github.repository == 'ReactionMechanismGenerator/RMG-Py' | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Build (and Push if on main) | |
| uses: docker/build-push-action@v6 | |
| env: | |
| BUILDKIT_PROGRESS: plain | |
| with: | |
| push: ${{ github.ref == 'refs/heads/main' && github.repository == 'ReactionMechanismGenerator/RMG-Py' }} | |
| tags: reactionmechanismgenerator/rmg:latest | |
| build-args: | | |
| RMS_Branch=for_rmg |