From 89f7632b06a40a39f7de6121617f6d5636980889 Mon Sep 17 00:00:00 2001 From: Brad Lugo Date: Fri, 15 Dec 2023 17:03:54 -0800 Subject: [PATCH] WIP --- .github/workflows/build.yaml | 87 ++++++++++++++++++++++++------------ 1 file changed, 59 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 65b6c7c9f..d2e0792ce 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -64,10 +64,12 @@ jobs: name: scanner-build path: scanner-build.tgz - style-checks: + style-check: + env: + ARTIFACT_DIR: junit-reports/ runs-on: ubuntu-latest container: - image: quay.io/stackrox-io/apollo-ci:scanner-test-0.3.61 + image: quay.io/stackrox-io/apollo-ci:stackrox-test-0.3.61 steps: - name: Checkout uses: actions/checkout@v4 @@ -77,11 +79,18 @@ jobs: - uses: ./.github/actions/job-preamble + - name: Cache Go dependencies + uses: ./.github/actions/cache-go-dependencies + + - name: Create artifacts dir + run: mkdir -p "$ARTIFACT_DIR" + - name: Run style checks - run: - ./scripts/ci/jobs/style-checks.sh + run: ./scripts/ci/jobs/style-checks.sh unit-tests: + env: + ARTIFACT_DIR: junit-reports/ runs-on: ubuntu-latest needs: - pre-build-scanner @@ -96,6 +105,12 @@ jobs: - uses: ./.github/actions/job-preamble + - name: Cache Go dependencies + uses: ./.github/actions/cache-go-dependencies + + - name: Create artifacts dir + run: mkdir -p "$ARTIFACT_DIR" + - uses: actions/download-artifact@v3 with: name: scanner-build @@ -122,6 +137,12 @@ jobs: - uses: ./.github/actions/job-preamble + - name: Cache Go dependencies + uses: ./.github/actions/cache-go-dependencies + + - name: Create artifacts dir + run: mkdir -p "$ARTIFACT_DIR" + - uses: actions/download-artifact@v3 with: name: scanner-build @@ -131,7 +152,7 @@ jobs: tar xvzf scanner-build.tgz - name: Run db integration tests - run: ./scripts/ci/jobs/unit_tests.sh + run: ./scripts/ci/jobs/db-integration-tests.sh generate-genesis-dump: runs-on: ubuntu-latest @@ -250,7 +271,7 @@ jobs: run: image/scanner/rhel/create-bundle.sh image/scanner image/scanner/rhel - name: Bundle the bundle to preserve permissions # TODO: word this better? - run: tar -cvzf bundle.tgz image/db/rhel + run: tar -cvzf bundle.tgz image/scanner/rhel - uses: actions/upload-artifact@v3 with: @@ -344,28 +365,28 @@ jobs: run: | docker login -u "${QUAY_RHACS_ENG_RO_USERNAME}" --password-stdin quay.io <<<"${QUAY_RHACS_ENG_RO_PASSWORD}" - - name: Push images - # Skip for external contributions. - if: | - github.event_name == 'push' || !github.event.pull_request.head.repo.fork - run: | - source ./scripts/ci/lib.sh - echo "Will determine context from: ${{ github.event_name }} & ${{ github.ref_name }}" - push_context="" - if [[ "${{ github.event_name }}" == "push" && "${{ github.ref_name }}" == "master" ]]; then - push_context="merge-to-master" - fi - push_main_image_set "$push_context" "${{ env.ROX_PRODUCT_BRANDING }}" "${{ matrix.arch }}" - - - name: Push matching collector and scanner images - # Skip for external contributions. - if: | - github.event_name == 'push' || !github.event.pull_request.head.repo.fork - run: | - # Need to free up some space before push_matching_collector_scanner_images() does its pull. - docker system prune --all --force - source ./scripts/ci/lib.sh - push_matching_collector_scanner_images "${{ env.ROX_PRODUCT_BRANDING }}" "${{ matrix.arch }}" +# - name: Push images +# # Skip for external contributions. +# if: | +# github.event_name == 'push' || !github.event.pull_request.head.repo.fork +# run: | +# source ./scripts/ci/lib.sh +# echo "Will determine context from: ${{ github.event_name }} & ${{ github.ref_name }}" +# push_context="" +# if [[ "${{ github.event_name }}" == "push" && "${{ github.ref_name }}" == "master" ]]; then +# push_context="merge-to-master" +# fi +# push_main_image_set "$push_context" "${{ env.ROX_PRODUCT_BRANDING }}" "${{ matrix.arch }}" +# +# - name: Push matching collector and scanner images +# # Skip for external contributions. +# if: | +# github.event_name == 'push' || !github.event.pull_request.head.repo.fork +# run: | +# # Need to free up some space before push_matching_collector_scanner_images() does its pull. +# docker system prune --all --force +# source ./scripts/ci/lib.sh +# push_matching_collector_scanner_images "${{ env.ROX_PRODUCT_BRANDING }}" "${{ matrix.arch }}" diff-dumps: runs-on: ubuntu-latest @@ -391,6 +412,8 @@ jobs: run: ./scripts/ci/jobs/diff-dumps.sh store-genesis-dump: + env: + ARTIFACT_DIR: artifacts/ runs-on: ubuntu-latest needs: - generate-genesis-dump @@ -405,6 +428,9 @@ jobs: - uses: ./.github/actions/job-preamble + - name: Create artifacts dir + run: mkdir -p "$ARTIFACT_DIR" + - uses: actions/download-artifact@v3 with: name: genesis-dump @@ -415,6 +441,8 @@ jobs: ./scripts/ci/jobs/store-genesis-dump.sh store-db-dump: + env: + ARTIFACT_DIR: artifacts/ runs-on: ubuntu-latest needs: - generate-db-dump @@ -429,6 +457,9 @@ jobs: - uses: ./.github/actions/job-preamble + - name: Create artifacts dir + run: mkdir -p "$ARTIFACT_DIR" + - uses: actions/download-artifact@v3 with: name: db-dump