Skip to content
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

Verify reproducibility under some circumstances #127

Merged
merged 2 commits into from
Jul 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 39 additions & 2 deletions .github/workflows/mega-module.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,43 @@ concurrency:
group: presubmit-build-${{ github.head_ref }}
cancel-in-progress: true

permissions:
# WARNING: This is mattmoor being a bit *too* clever.
# We want to be able to test the reproducibility of things via the upstream
# check-reproducibility test, which requires ambient credentials, but those
# are only available to pull requests under two circumstances:
# 1. The trigger is `pull_request_target`, and
# 2. The pull request is from a branch on the main repo.
# However, this doesn't cause things to fail when the pull request is from a
# fork, it will just make the tf-cosign rules NOPs and the
# check-repoducibility skip.
#
# But why not just use pull_request_target?
# This is because to pull in breaking changes to apko, we will need to update
# our apko Go dependency and the APKO_IMAGE (below) in the same PR, and the
# latter cannot be checked with the former if the workflow is
# pull_request_target.
#
# All of that said, dependabot and digestabot PRs come from branches on the
# main repo, so the net effect of this SHOULD be that we get an error
# presubmit when digestabot wants to pull in an update that is not
# reproducible with the version of the apko Go library we depend on.
id-token: write

jobs:
build-the-world:
runs-on: ubuntu-latest

steps:
# In some cases, we runs out of disk space during tests, so this hack frees up approx 10G.
# See the following issue for more info: https://github.com/actions/runner-images/issues/2840#issuecomment-1284059930
- name: Free up runner disk space
shell: bash
run: |
set -x
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"

- uses: actions/setup-go@v4
with:
go-version: '1.20'
Expand All @@ -25,6 +57,10 @@ jobs:
- working-directory: tf-apko
run: go build .

# Make cosign/crane CLI available to the tests
- uses: sigstore/[email protected]
- uses: imjasonh/[email protected]

- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 # v3.1.0
with:
repository: chainguard-images/images
Expand Down Expand Up @@ -59,8 +95,9 @@ jobs:
-target=module.go \
-target=module.jdk \
-target=module.python \
-target=module.kubernetes \
-target=module.k3s
-target=module.kubernetes
# TODO(joshwolf): reinclude this once we understand why the tests are failing.
# -target=module.k3s

- name: Collect diagnostics and upload
if: ${{ failure() }}
Expand Down