Skip to content

Merge pull request #24 from su2code/feature_asan #27

Merge pull request #24 from su2code/feature_asan

Merge pull request #24 from su2code/feature_asan #27

name: Upload Docker images
permissions:
packages: write
on:
push:
branches:
- 'master'
jobs:
date-tag:
runs-on: ubuntu-latest
outputs:
date_tag: ${{ steps.vars.outputs.date_tag }}
steps:
- name: Set variables
id: vars
run: echo "date_tag=$(date +%y%m%d-%H%M)" >> "$GITHUB_OUTPUT"
build-su2:
needs: [date-tag]
if: ${{ always() && !(contains(needs.*.result, 'failure')) }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Github Docker Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Buildx Create
run: docker buildx create --use
- name: Build and push build-su2
run: docker buildx build --platform=linux/amd64 --platform=linux/arm64 -t ghcr.io/${{ github.repository_owner }}/su2/build-su2:${{ needs.date-tag.outputs.date_tag }} --push ./build/
build-su2-tsan-platforms:
needs: [date-tag]
if: ${{ always() && !(contains(needs.*.result, 'failure')) }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform: [amd64] # arm64
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Github Docker Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Buildx Create
run: docker buildx create --use
- name: Build and push single-platform build-su2-tsan
run: docker buildx build --platform=linux/${{ matrix.platform }} -t ghcr.io/${{ github.repository_owner }}/su2/build-su2-tsan-${{ matrix.platform }}:${{ needs.date-tag.outputs.date_tag }} --push --file ./build/Dockerfile.tsan ./build/
build-su2-tsan:
needs: [date-tag, build-su2-tsan-platforms]
if: ${{ always() && !(contains(needs.*.result, 'failure')) }}
runs-on: ubuntu-latest
steps:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Github Docker Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Buildx Create
run: docker buildx create --use
- name: Merge single-platform build-su2-tsan images
run: docker buildx imagetools create -t ghcr.io/${{ github.repository_owner }}/su2/build-su2-tsan:${{ needs.date-tag.outputs.date_tag }} ghcr.io/${{ github.repository_owner }}/su2/build-su2-tsan-amd64:${{ needs.date-tag.outputs.date_tag }}
# ghcr.io/${{ github.repository_owner }}/su2/build-su2-tsan-arm64:${{ needs.date-tag.outputs.date_tag }}
build-su2-asan:
needs: [date-tag, build-su2]
if: ${{ always() && !(contains(needs.*.result, 'failure')) }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Github Docker Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Buildx Create
run: docker buildx create --use
- name: Build and push build-su2-asan
run: docker buildx build --platform=linux/amd64 --platform=linux/arm64 --build-arg BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/su2/build-su2:${{ needs.date-tag.outputs.date_tag }} -t ghcr.io/${{ github.repository_owner }}/su2/build-su2-asan:${{ needs.date-tag.outputs.date_tag }} --push --file ./build/Dockerfile.asan ./build/
test-su2:
needs: [date-tag, build-su2, build-su2-tsan, build-su2-asan]
if: ${{ always() && !(contains(needs.*.result, 'failure')) }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Github Docker Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Buildx Create
run: docker buildx create --use
- name: Build and push test-su2
run: docker buildx build --platform=linux/amd64 --platform=linux/arm64 --build-arg BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/su2/build-su2:${{ needs.date-tag.outputs.date_tag }} -t ghcr.io/${{ github.repository_owner }}/su2/test-su2:${{ needs.date-tag.outputs.date_tag }} --push ./test/
- name: Build and push test-su2-tsan
run: docker buildx build --platform=linux/amd64 --build-arg BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/su2/build-su2-tsan:${{ needs.date-tag.outputs.date_tag }} -t ghcr.io/${{ github.repository_owner }}/su2/test-su2-tsan:${{ needs.date-tag.outputs.date_tag }} --push ./test/
# --platform=linux/arm64
- name: Build and push test-su2-asan
run: docker buildx build --platform=linux/amd64 --platform=linux/arm64 --build-arg BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/su2/build-su2-asan:${{ needs.date-tag.outputs.date_tag }} -t ghcr.io/${{ github.repository_owner }}/su2/test-su2-asan:${{ needs.date-tag.outputs.date_tag }} --push ./test/
cross-build-su2-mac:
needs: [date-tag, build-su2]
if: ${{ always() && !(contains(needs.*.result, 'failure')) }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Github Docker Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Buildx Create
run: docker buildx create --use
- name: Build and push build-su2-cross
run: docker buildx build --platform=linux/amd64 --platform=linux/arm64 --build-arg BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/su2/build-su2:${{ needs.date-tag.outputs.date_tag }} -t ghcr.io/${{ github.repository_owner }}/su2/build-su2-cross-stage1:${{ needs.date-tag.outputs.date_tag }} --push --file ./build_cross/Dockerfile.stage1 ./build_cross/
cross-build-su2-linux:
needs: [date-tag, build-su2, cross-build-su2-mac]
if: ${{ always() && !(contains(needs.*.result, 'failure')) }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
with:
platforms: arm64
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Github Docker Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker Buildx Create
run: docker buildx create --use
- name: Build and push build-su2-cross
run: docker buildx build --platform=linux/amd64 --platform=linux/arm64 --build-arg BASE_IMAGE=ghcr.io/${{ github.repository_owner }}/su2/build-su2-cross-stage1:${{ needs.date-tag.outputs.date_tag }} -t ghcr.io/${{ github.repository_owner }}/su2/build-su2-cross:${{ needs.date-tag.outputs.date_tag }} --push --file ./build_cross/Dockerfile.stage2 ./build_cross/