-
Notifications
You must be signed in to change notification settings - Fork 5
91 lines (81 loc) · 2.73 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
name: Continuous Integration
on:
push:
schedule:
- cron: 0 0 * * 0
defaults:
run:
shell: 'bash -Eeuo pipefail -x {0}'
env:
IMAGE_NAME: docker-postgresql
jobs:
generate-jobs:
name: Generate Jobs
runs-on: ubuntu-22.04
outputs:
strategy: ${{ steps.generate-jobs.outputs.strategy }}
steps:
- uses: actions/checkout@v4
- id: generate-jobs
name: Generate Jobs
run: .github/generate-strategy.sh
test:
needs: generate-jobs
strategy: ${{ fromJson(needs.generate-jobs.outputs.strategy) }}
name: PostgreSQL ${{ matrix.name }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Prepare Environment
run: |
git clone --depth 1 https://github.com/docker-library/official-images.git -b master ~/oi
# create a dummy empty image/layer so we can --filter since= later to get a meaningful image list
{ echo FROM busybox:latest; echo RUN :; } | docker build --no-cache --tag image-list-marker -
# PGP Happy Eyeballs
git clone --depth 1 https://github.com/tianon/pgp-happy-eyeballs.git ~/phe
~/phe/hack-my-builds.sh
rm -rf ~/phe
- name: Docker meta
env:
TAGS: ${{ toJson(matrix.tags) }}
run: |
RESULT=""
for tag in $(jq -r '.[]' <<< "${TAGS}")
do
RESULT="${RESULT},${IMAGE_NAME}:${tag}"
done
echo "TAGS=${RESULT%,}" >> $GITHUB_ENV
- name: Build ${{ matrix.name }}
uses: docker/build-push-action@v6
with:
context: ${{ matrix.dir }}
file: ${{ matrix.file }}
secrets: |
"cs_token=${{ secrets.CS_TOKEN }}"
"subscription=${{ secrets.SUBSCRIPTION }}"
push: false
provenance: false
tags: ${{ env.TAGS }}
load: true
build-args: |
SUBSCRIPTION_NAME=docker-postgresql-ci-${{ github.run_number }}
- name: History ${{ matrix.name }}
run: docker history "${IMAGE_NAME}:${{ matrix.tags[0] }}"
- name: Test ${{ matrix.name }}
run: ~/oi/test/run.sh "${IMAGE_NAME}:${{ matrix.tags[0] }}"
- name: '"docker images"'
run: docker image ls --filter since=image-list-marker
- name: docker images labels
run: docker image ls --filter since=image-list-marker --format "{{.Repository}}:{{.Tag}}" | xargs docker inspect | jq -r '.[] | "\(.RepoTags[]) \(.Config.Labels)"'
check:
if: always()
needs:
- generate-jobs
- test
name: Check
runs-on: ubuntu-22.04
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/[email protected]
with:
jobs: ${{ toJSON(needs) }}