Skip to content

Commit b6a7a3c

Browse files
committed
test docker
1 parent 6c30a53 commit b6a7a3c

File tree

2 files changed

+71
-86
lines changed

2 files changed

+71
-86
lines changed

.github/workflows/integrate.yaml

Lines changed: 71 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -8,52 +8,80 @@ on:
88
- 'master'
99

1010
jobs:
11-
goreleaser:
11+
# goreleaser:
12+
# runs-on: 'ubuntu-latest'
13+
# permissions:
14+
# contents: 'write' # Needs write access for upload-artifact.
15+
# outputs:
16+
# hashes: '${{ steps.outputs.outputs.hashes }}'
17+
# steps:
18+
# - name: 'checkout'
19+
# uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' # ratchet:actions/checkout@v5
20+
# with:
21+
# fetch-depth: 0 # So that goreleaser can determine the base version.
22+
# - name: 'build'
23+
# id: 'goreleaser'
24+
# uses: 'goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a' # ratchet:goreleaser/goreleaser-action@v6
25+
# with:
26+
# args: 'release --snapshot --clean --skip docker --skip publish'
27+
# version: '~> v1'
28+
# - name: 'get version'
29+
# id: 'version'
30+
# shell: 'bash'
31+
# run: |
32+
# echo "version=$(jq -r .version dist/metadata.json)" >> "$GITHUB_OUTPUT"
33+
# - name: 'upload'
34+
# uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # ratchet:actions/upload-artifact@v4
35+
# with:
36+
# name: 'conftest_${{ steps.version.outputs.version }}'
37+
# path: 'dist/*.*'
38+
# retention-days: 30
39+
# - name: 'generate outputs'
40+
# id: 'outputs'
41+
# env:
42+
# GORELEASER_ARTIFACTS: '${{ steps.goreleaser.outputs.artifacts }}'
43+
# shell: 'bash'
44+
# run: |
45+
# set -euo pipefail
46+
47+
# checksum_file=$(echo "${GORELEASER_ARTIFACTS}" | jq -r '.[] | select (.type == "Checksum") | .path' | tr -d '\n')
48+
# echo "hashes=$(cat ${checksum_file} | base64 -w0)" >> "$GITHUB_OUTPUT"
49+
50+
# binary-provenance:
51+
# needs: ['goreleaser']
52+
# permissions:
53+
# contents: 'write' # Needs write access for upload-artifact even when upload-assets is false.
54+
# actions: 'read' # To read the workflow path.
55+
# id-token: 'write' # To sign the provenance.
56+
# uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.1.0 # ratchet:exclude
57+
# with:
58+
# base64-subjects: '${{ needs.goreleaser.outputs.hashes }}'
59+
# upload-assets: false
60+
61+
docker:
1262
runs-on: 'ubuntu-latest'
1363
permissions:
14-
contents: 'write' # Needs write access for upload-artifact.
64+
contents: 'read'
1565
outputs:
16-
hashes: '${{ steps.outputs.outputs.hashes }}'
66+
digest: '${{ steps.build.outputs.digest }}'
67+
env:
68+
CONFTEST_IMAGE: 'openpolicyagent/conftest'
69+
strategy:
70+
matrix:
71+
target:
72+
- '' # Conftest
73+
# - 'examples' # Examples
74+
platform:
75+
- 'linux/amd64'
76+
# - 'linux/arm64'
1777
steps:
18-
- name: 'checkout'
19-
uses: 'actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8' # ratchet:actions/checkout@v5
20-
with:
21-
fetch-depth: 0 # So that goreleaser can determine the base version.
78+
- name: 'setup docker buildx'
79+
run: 'docker buildx create --name conftestbuild --use'
2280
- name: 'build'
23-
id: 'goreleaser'
24-
uses: 'goreleaser/goreleaser-action@e435ccd777264be153ace6237001ef4d979d3a7a' # ratchet:goreleaser/goreleaser-action@v6
81+
id: 'build'
82+
uses: 'docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83' # ratchet:docker/build-push-action@v6
2583
with:
26-
args: 'release --snapshot --clean --skip docker --skip publish'
27-
version: '~> v1'
28-
- name: 'get version'
29-
id: 'version'
30-
shell: 'bash'
31-
run: |
32-
echo "version=$(jq -r .version dist/metadata.json)" >> "$GITHUB_OUTPUT"
33-
- name: 'upload'
34-
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # ratchet:actions/upload-artifact@v4
35-
with:
36-
name: 'conftest_${{ steps.version.outputs.version }}'
37-
path: 'dist/*.*'
38-
retention-days: 30
39-
- name: 'generate outputs'
40-
id: 'outputs'
41-
env:
42-
GORELEASER_ARTIFACTS: '${{ steps.goreleaser.outputs.artifacts }}'
43-
shell: 'bash'
44-
run: |
45-
set -euo pipefail
46-
47-
checksum_file=$(echo "${GORELEASER_ARTIFACTS}" | jq -r '.[] | select (.type == "Checksum") | .path' | tr -d '\n')
48-
echo "hashes=$(cat ${checksum_file} | base64 -w0)" >> "$GITHUB_OUTPUT"
49-
50-
provenance:
51-
needs: ['goreleaser']
52-
permissions:
53-
contents: 'write' # Needs write access for upload-artifact even when upload-assets is false.
54-
actions: 'read' # To read the workflow path.
55-
id-token: 'write' # To sign the provenance.
56-
uses: slsa-framework/slsa-github-generator/.github/workflows/generator_generic_slsa3.yml@v2.1.0 # ratchet:exclude
57-
with:
58-
base64-subjects: '${{ needs.goreleaser.outputs.hashes }}'
59-
upload-assets: false
84+
push: false
85+
# target: '${{ matrix.target }}'
86+
tags: '${{ env.CONFTEST_IMAGE }}:latest'
87+
# platforms: '${{ matrix.platform }}'

.github/workflows/pr.yaml

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -127,46 +127,3 @@ jobs:
127127
- name: test oci push/pull
128128
if: ${{ matrix.os == 'ubuntu-latest' }}
129129
run: ./scripts/push-pull-e2e.sh
130-
131-
docker-conftest:
132-
runs-on: ubuntu-latest
133-
needs:
134-
- validate
135-
steps:
136-
- name: checkout source
137-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # ratchet:actions/checkout@v5
138-
139-
- name: setup docker buildx
140-
run: docker buildx create --name conftestbuild --use
141-
142-
- name: Build Docker image
143-
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # ratchet:docker/build-push-action@v6
144-
with:
145-
context: .
146-
push: false
147-
# The foo tag below validates putting one tag per line (like we do in the release flow)
148-
# works as expected.
149-
tags: |
150-
${{ env.IMAGE }}:latest
151-
${{ env.IMAGE }}:foo
152-
platforms: ${{ env.PLATFORMS }}
153-
154-
docker-examples:
155-
runs-on: ubuntu-latest
156-
needs:
157-
- validate
158-
steps:
159-
- name: checkout source
160-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # ratchet:actions/checkout@v5
161-
162-
- name: setup docker buildx
163-
run: docker buildx create --name conftestbuild --use
164-
165-
- name: Build Docker image
166-
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # ratchet:docker/build-push-action@v6
167-
with:
168-
context: .
169-
target: examples
170-
push: false
171-
tags: ${{ env.IMAGE }}:examples
172-
platforms: ${{ env.PLATFORMS }}

0 commit comments

Comments
 (0)