CI #266
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
| name: CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| schedule: | |
| - cron: '0 5 * * FRI' | |
| concurrency: | |
| group: ${ {github.event_name }}-${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{github.event_name == 'pull_request'}} | |
| jobs: | |
| CI: | |
| continue-on-error: ${{ matrix.config.continue-on-error == 'true' }} | |
| strategy: | |
| matrix: | |
| config: | |
| - {dockerfile: 'fedora', tag: 'latest-amd64'} | |
| - {dockerfile: 'fedora', tag: 'latest-arm64', arch: 'arm64'} | |
| - {dockerfile: 'fedora', tag: 'rawhide', build_args: 'TAG=rawhide', continue-on-error: 'true'} | |
| - {dockerfile: 'ubuntu', tag: 'latest-amd64'} | |
| - {dockerfile: 'ubuntu', tag: 'latest-arm64', arch: 'arm64'} | |
| - {dockerfile: 'ubuntu', tag: 'rolling', build_args: 'TAG=rolling'} | |
| - {dockerfile: 'ubuntu', tag: 'devel', build_args: 'TAG=devel', continue-on-error: 'true'} | |
| - {dockerfile: 'opensuse', tag: 'latest'} | |
| - {dockerfile: 'ubuntu', tag: 'intel', build_args: 'TAG=intel,INTEL=yes'} | |
| - {dockerfile: 'fedora', tag: 'nompi', build_args: 'MPI=no'} | |
| - {dockerfile: 'rocm', tag: 'latest', continue-on-error: 'true'} | |
| - {dockerfile: 'cuda', tag: '12.2.0', continue-on-error: 'true'} | |
| runs-on: ${{ matrix.config.arch == 'arm64' && 'ubuntu-24.04-arm' || 'ubuntu-latest' }} | |
| steps: | |
| - name: Checkout out code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Github Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Convert build_args | |
| id: build_args | |
| run: | | |
| echo "args<<EOF" >> $GITHUB_OUTPUT | |
| echo ${{ matrix.config.build_args }} | sed 's/,/\n/g' >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| - name: Build and Push Docker images for Github Container Registry | |
| uses: docker/build-push-action@v6 | |
| with: | |
| tags: ghcr.io/ecp-copa/ci-containers/${{ matrix.config.dockerfile }}:${{ matrix.config.tag }} | |
| file: ${{ matrix.config.dockerfile }} | |
| build-args: ${{ steps.build_args.outputs.args }} | |
| pull: true | |
| push: ${{ github.event_name == 'push' || github.event_name == 'schedule' }} | |
| provenance: false | |
| merge-docker-manifest: | |
| runs-on: ubuntu-latest | |
| needs: CI | |
| strategy: | |
| matrix: | |
| config: | |
| - {dockerfile: 'fedora', tag: 'latest'} | |
| - {dockerfile: 'ubuntu', tag: 'latest'} | |
| env: | |
| docker-tag: ghcr.io/ecp-copa/ci-containers/${{ matrix.config.dockerfile }}:${{ matrix.config.tag }} | |
| steps: | |
| - name: Login to Github Container Registry | |
| if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }} | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create and push manifest images to Github Container Registry | |
| if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }} | |
| uses: Noelware/docker-manifest-action@0.4.3 | |
| with: | |
| inputs: ${{ env.docker-tag }} | |
| images: ${{ env.docker-tag }}-amd64,${{ env.docker-tag }}-arm64 | |
| push: ${{ github.event_name == 'push' || github.event_name == 'schedule' }} |