Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
BradLugo committed Dec 16, 2023
1 parent 7aca1c8 commit 89f7632
Showing 1 changed file with 59 additions and 28 deletions.
87 changes: 59 additions & 28 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 89f7632

Please sign in to comment.