Skip to content

Commit

Permalink
Revert "Removing changes to try and pinpoint source of test regression"
Browse files Browse the repository at this point in the history
This reverts commit 3ca8284.
  • Loading branch information
kylape committed Jan 10, 2024
1 parent c49855c commit 8ffd7a2
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .containerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# This file is derived of the .dockerignore
# It is required to pass `.git` to the builder containers on RHTAP so we can bake build information into the binary.
# It is required to pass the `.gitignore` files in `image/bin/` and `bin` to avoid a dirty version.
# RHTAP uses Buildah which first looks up for `.containerignore`, then, if absent, `.dockerignore`.
# Having this file enables us to have different exclusion list for RHTAP builds than in GHA/OSCI.
# To regenerate, replace the below contents with the output of the following command (please keep these comments).
# grep -vF -e '/.git/' -e '/bin/' -e '/image/bin/' .dockerignore

# currently empty!
17 changes: 17 additions & 0 deletions .github/actions/job-preamble/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Job Preamble
description: Common steps for most jobs
runs:
using: composite
steps:
- name: Recover docker image cache space
run: |
df --si /
docker system prune --force --all
df --si /
shell: bash

- name: Ignore dubious repository ownership
run: |
# Prevent fatal error "detected dubious ownership in repository" from recent git.
git config --global --add safe.directory "$(pwd)"
shell: bash
28 changes: 28 additions & 0 deletions .github/workflows/style.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Style
on:
push:
tags:
- '*'
branches:
- master
pull_request:
types:
- opened
- reopened
- synchronize
jobs:
check-generated-files:
runs-on: ubuntu-latest
container:
image: quay.io/stackrox-io/apollo-ci:scanner-test-0.3.61
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.sha }}

- uses: ./.github/actions/job-preamble

- name: Check Generated
run: scripts/ci/jobs/check-generated.sh
31 changes: 31 additions & 0 deletions scripts/ci/jobs/check-generated.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash

ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")"/../../.. && pwd)"
# shellcheck source=../../../scripts/ci/lib.sh
source "$ROOT/scripts/ci/lib.sh"

set -euo pipefail

FAIL_FLAG="/tmp/fail"

info 'Check .containerignore file is in sync with .dockerignore (If this fails, follow instructions in .containerignore to update it.)'
function check-containerignore-is-in-sync() {
diff \
--unified \
--ignore-blank-lines \
<(grep -v -e '^#' .containerignore) \
<(grep -vF -e '/.git/' -e '/image/' -e '/bin/' .dockerignore) \
> diff.txt
}
check-containerignore-is-in-sync || {
info ".containerignore file is not in sync with .dockerignore"
info "$(cat diff.txt)"
git reset --hard HEAD
echo check-containerignore-is-in-sync >> "$FAIL_FLAG"
}

if [[ -e "$FAIL_FLAG" ]]; then
echo "ERROR: Some generated file checks failed:"
cat "$FAIL_FLAG"
exit 1
fi

0 comments on commit 8ffd7a2

Please sign in to comment.