Skip to content

Commit

Permalink
Merge pull request #24 from su2code/feature_asan
Browse files Browse the repository at this point in the history
Containers for address sanitizer tests
  • Loading branch information
jblueh authored Mar 20, 2024
2 parents 0db23db + f0859c9 commit 4212d04
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
34 changes: 33 additions & 1 deletion .github/workflows/docker-image-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,37 @@ jobs:
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]
needs: [date-tag, build-su2, build-su2-tsan, build-su2-asan]
if: ${{ always() && !(contains(needs.*.result, 'failure')) }}
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -135,6 +164,9 @@ jobs:
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')) }}
Expand Down
7 changes: 7 additions & 0 deletions build/Dockerfile.asan
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ARG BASE_IMAGE=ghcr.io/su2code/su2/build-su2:220614-1237

FROM $BASE_IMAGE

# Enable address sanitizer
ENV CXXFLAGS="-fsanitize=address -fno-omit-frame-pointer $CXXFLAGS"
ENV CFLAGS="-fsanitize=address -fno-omit-frame-pointer $CFLAGS"

0 comments on commit 4212d04

Please sign in to comment.