2020-12-22 18:35:49 -06:00
|
|
|
name: Build docker CI images
|
2021-01-21 17:40:09 -06:00
|
|
|
on:
|
|
|
|
- workflow_dispatch
|
2021-10-18 12:55:43 -05:00
|
|
|
|
|
|
|
# Environment variables
|
|
|
|
env:
|
|
|
|
DOCKER_REPO: ${{ secrets.DOCKER_REPO }}
|
|
|
|
REPO_OWNER: ${{ github.repository_owner }}
|
|
|
|
|
2024-06-10 14:19:58 -05:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2020-12-22 18:35:49 -06:00
|
|
|
jobs:
|
2021-10-20 15:31:20 -05:00
|
|
|
change_detect:
|
|
|
|
name: "Detect code changes"
|
2024-05-05 18:15:45 -05:00
|
|
|
runs-on: ubuntu-22.04
|
2021-10-20 15:31:20 -05:00
|
|
|
outputs:
|
|
|
|
docker_repo: ${{ steps.changes.outputs.docker_repo }}
|
|
|
|
steps:
|
|
|
|
- name: Check for source code changes
|
|
|
|
id: changes
|
|
|
|
run: |
|
|
|
|
if [[ -n "${DOCKER_REPO}" ]]; then
|
|
|
|
echo "name=docker_repo::$REPO_OWNER"
|
|
|
|
echo "::set-output name=docker_repo::$REPO_OWNER"
|
|
|
|
else
|
|
|
|
echo "name=docker_repo::lnis-uofu"
|
|
|
|
echo "::set-output name=docker_repo::lnis-uofu"
|
|
|
|
fi
|
|
|
|
|
2020-12-22 18:35:49 -06:00
|
|
|
base_images:
|
|
|
|
name: Push Docker images
|
2021-10-20 15:31:20 -05:00
|
|
|
needs: [change_detect]
|
2020-12-22 18:35:49 -06:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2024-06-04 18:15:26 -05:00
|
|
|
uses: actions/checkout@v4
|
2020-12-22 18:35:49 -06:00
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
- name: Login to GitHub Container Registry
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
2021-10-18 12:55:43 -05:00
|
|
|
username: ${{ needs.change_detect.outputs.docker_repo }}
|
2020-12-22 18:35:49 -06:00
|
|
|
password: ${{ secrets.CR_PAT }}
|
|
|
|
- name: Build base
|
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: ./docker/Dockerfile.base
|
2021-10-20 15:31:20 -05:00
|
|
|
push: ${{ (env.DOCKER_REPO) && (github.ref == 'refs/heads/master')}}
|
2021-10-18 12:55:43 -05:00
|
|
|
tags: ghcr.io/${{ needs.change_detect.outputs.docker_repo }}/openfpga-build-base:latest
|
2021-01-20 15:20:12 -06:00
|
|
|
- name: Build environment image
|
2020-12-22 18:35:49 -06:00
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
context: .
|
2021-01-20 15:20:12 -06:00
|
|
|
file: ./docker/Dockerfile.env
|
2021-10-20 15:31:20 -05:00
|
|
|
push: ${{ (env.DOCKER_REPO) && (github.ref == 'refs/heads/master')}}
|
2021-10-18 12:55:43 -05:00
|
|
|
tags: ghcr.io/${{ needs.change_detect.outputs.docker_repo }}/openfpga-env:latest
|
2021-10-20 15:31:20 -05:00
|
|
|
|
2020-12-22 18:35:49 -06:00
|
|
|
compiler_images:
|
|
|
|
name: Build ${{ matrix.compiler }} compiler image
|
2021-10-20 15:31:20 -05:00
|
|
|
needs: [base_images, change_detect]
|
2020-12-22 18:35:49 -06:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
compiler:
|
|
|
|
- gcc-9
|
2022-08-24 17:58:16 -05:00
|
|
|
- gcc-10
|
|
|
|
- gcc-11
|
2024-05-05 18:15:45 -05:00
|
|
|
- gcc-12
|
|
|
|
- clang-11
|
|
|
|
- clang-12
|
|
|
|
- clang-13
|
|
|
|
- clang-14
|
2020-12-22 18:35:49 -06:00
|
|
|
steps:
|
|
|
|
- name: Checkout
|
2024-06-04 18:15:26 -05:00
|
|
|
uses: actions/checkout@v4
|
2020-12-22 18:35:49 -06:00
|
|
|
- name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
- name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
- name: Login to GitHub Container Registry
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
registry: ghcr.io
|
2021-10-18 12:55:43 -05:00
|
|
|
username: ${{ needs.change_detect.outputs.docker_repo }}
|
2020-12-22 18:35:49 -06:00
|
|
|
password: ${{ secrets.CR_PAT }}
|
|
|
|
- name: Build ${{ matrix.compiler }} image
|
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
context: .
|
|
|
|
file: ./docker/Dockerfile.${{ matrix.compiler }}
|
2021-10-20 15:31:20 -05:00
|
|
|
push: ${{ (env.DOCKER_REPO) && (github.ref == 'refs/heads/master')}}
|
2021-10-18 12:55:43 -05:00
|
|
|
tags: ghcr.io/${{ needs.change_detect.outputs.docker_repo }}/openfpga-build-${{ matrix.compiler }}:latest
|