-
Notifications
You must be signed in to change notification settings - Fork 1
Use ASAN when running unit tests in CI #56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature/new-script-worker
Are you sure you want to change the base?
Changes from all commits
f382ac0
13fe385
ad79691
bbcbdc6
0f8092e
d0c9a10
d4361de
8ae6009
24702de
6572533
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,8 @@ concurrency: | |
| jobs: | ||
| build-and-push: | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| tag: ${{ steps.get-tag.outputs.tag }} | ||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| with: | ||
|
|
@@ -23,39 +25,78 @@ jobs: | |
| - run: make build-berserker-network | ||
|
|
||
| - name: Get tag | ||
| run: | | ||
| TAG="$(make tag)" | ||
| echo "TAG=$TAG" >> "$GITHUB_ENV" | ||
| id: get-tag | ||
| run: echo "tag=$(make tag)" >> "$GITHUB_OUTPUT" | ||
|
|
||
| - name: Retag and push builder to rhacs-eng | ||
| uses: stackrox/actions/images/retag-and-push@v1 | ||
| with: | ||
| src-image: builder | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The builder is now pushed to make it easier to use for the unit tests. |
||
| dst-image: quay.io/rhacs-eng/qa:berserker-builder-${{ steps.get-tag.outputs.tag }} | ||
| username: ${{ secrets.QUAY_RHACS_ENG_RW_USERNAME }} | ||
| password: ${{ secrets.QUAY_RHACS_ENG_RW_PASSWORD }} | ||
|
|
||
| - name: Retag and push builder to stackrox-io | ||
| uses: stackrox/actions/images/retag-and-push@v1 | ||
| with: | ||
| src-image: builder | ||
| dst-image: quay.io/stackrox-io/berserker:builder-${{ steps.get-tag.outputs.tag }} | ||
| username: ${{ secrets.QUAY_STACKROX_IO_RW_USERNAME }} | ||
| password: ${{ secrets.QUAY_STACKROX_IO_RW_PASSWORD }} | ||
|
|
||
| - name: Retag and push berserker to rhacs-eng | ||
| uses: stackrox/actions/images/retag-and-push@v1 | ||
| with: | ||
| src-image: berserker | ||
| dst-image: quay.io/rhacs-eng/qa:berserker-${{ env.TAG }} | ||
| dst-image: quay.io/rhacs-eng/qa:berserker-${{ steps.get-tag.outputs.tag }} | ||
| username: ${{ secrets.QUAY_RHACS_ENG_RW_USERNAME }} | ||
| password: ${{ secrets.QUAY_RHACS_ENG_RW_PASSWORD }} | ||
|
|
||
| - name: Retag and push berserker to stackrox-io | ||
| uses: stackrox/actions/images/retag-and-push@v1 | ||
| with: | ||
| src-image: berserker | ||
| dst-image: quay.io/stackrox-io/berserker:${{ env.TAG }} | ||
| dst-image: quay.io/stackrox-io/berserker:${{ steps.get-tag.outputs.tag }} | ||
| username: ${{ secrets.QUAY_STACKROX_IO_RW_USERNAME }} | ||
| password: ${{ secrets.QUAY_STACKROX_IO_RW_PASSWORD }} | ||
|
|
||
| - name: Retag and push berserker-network to rhacs-eng | ||
| uses: stackrox/actions/images/retag-and-push@v1 | ||
| with: | ||
| src-image: berserker-network | ||
| dst-image: quay.io/rhacs-eng/qa:berserker-network-${{ env.TAG }} | ||
| dst-image: quay.io/rhacs-eng/qa:berserker-network-${{ steps.get-tag.outputs.tag }} | ||
| username: ${{ secrets.QUAY_RHACS_ENG_RW_USERNAME }} | ||
| password: ${{ secrets.QUAY_RHACS_ENG_RW_PASSWORD }} | ||
|
|
||
| - name: Retag and push berserker-network to stackrox-io | ||
| uses: stackrox/actions/images/retag-and-push@v1 | ||
| with: | ||
| src-image: berserker-network | ||
| dst-image: quay.io/stackrox-io/berserker:network-${{ env.TAG }} | ||
| dst-image: quay.io/stackrox-io/berserker:network-${{ steps.get-tag.outputs.tag }} | ||
| username: ${{ secrets.QUAY_STACKROX_IO_RW_USERNAME }} | ||
| password: ${{ secrets.QUAY_STACKROX_IO_RW_PASSWORD }} | ||
|
|
||
| unit-tests: | ||
| name: unit-tests (${{ matrix.test-type.name }}) | ||
| needs: build-and-push | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| test-type: | ||
| - name: standard | ||
| command: cargo test | ||
| - name: asan | ||
| command: | | ||
| curl --proto "=https" --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain nightly && | ||
| source "${HOME}"/.cargo/env && | ||
| rustup component add rust-src --toolchain nightly && | ||
| TARGET=$(rustc --version --verbose | grep host | cut -d" " -f2) && | ||
| RUSTFLAGS="-Z sanitizer=address" cargo +nightly test -Z build-std --target "$TARGET" | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tests are invoked from the image itself nowadays: |
||
| steps: | ||
| - name: Pull builder image | ||
| run: docker pull quay.io/stackrox-io/berserker:builder-${{ needs.build-and-push.outputs.tag }} | ||
|
|
||
| - name: Run ${{ matrix.test-type.name }} tests | ||
| run: docker run --rm quay.io/stackrox-io/berserker:builder-${{ needs.build-and-push.outputs.tag }} bash -c '${{ matrix.test-type.command }}' | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Multiple jobs now use the tag so it is helpful to add it as output.