Skip to content

Commit 9f564c2

Browse files
authored
Merge pull request #721 from docker-library/github-actions
Add initial GitHub Actions CI
2 parents a6d35fb + 986d94f commit 9f564c2

File tree

5 files changed

+77
-65
lines changed

5 files changed

+77
-65
lines changed

.github/workflows/ci.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: GitHub CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
schedule:
7+
- cron: 0 0 * * 0
8+
9+
defaults:
10+
run:
11+
shell: 'bash -Eeuo pipefail -x {0}'
12+
13+
jobs:
14+
15+
generate-jobs:
16+
name: Generate Jobs
17+
runs-on: ubuntu-latest
18+
outputs:
19+
strategy: ${{ steps.generate-jobs.outputs.strategy }}
20+
steps:
21+
- uses: actions/checkout@v1
22+
- id: generate-jobs
23+
name: Generate Jobs
24+
run: |
25+
git clone --depth 1 https://github.com/docker-library/bashbrew.git -b master ~/bashbrew
26+
strategy="$(~/bashbrew/scripts/github-actions/generate.sh)"
27+
strategy="$(.github/workflows/munge.sh -c <<<"$strategy")"
28+
jq . <<<"$strategy" # sanity check / debugging aid
29+
echo "::set-output name=strategy::$strategy"
30+
31+
test:
32+
needs: generate-jobs
33+
strategy: ${{ fromJson(needs.generate-jobs.outputs.strategy) }}
34+
name: ${{ matrix.name }}
35+
runs-on: ${{ matrix.os }}
36+
steps:
37+
- uses: actions/checkout@v1
38+
- name: Prepare Environment
39+
run: ${{ matrix.runs.prepare }}
40+
- name: Pull Dependencies
41+
run: ${{ matrix.runs.pull }}
42+
- name: Build ${{ matrix.name }}
43+
run: ${{ matrix.runs.build }}
44+
- name: History ${{ matrix.name }}
45+
run: ${{ matrix.runs.history }}
46+
- name: Test ${{ matrix.name }}
47+
run: ${{ matrix.runs.test }}
48+
- name: '"docker images"'
49+
run: ${{ matrix.runs.images }}

.github/workflows/munge.sh

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env bash
2+
set -Eeuo pipefail
3+
4+
# copy all the Debian build jobs into "force deb build" jobs which build like architectures upstream doesn't publish for will
5+
jq \
6+
--arg prefix '[ "$(dpkg --print-architecture)" = "amd64" ]' \
7+
--arg dfMunge 'grep -qE "amd64 [|] " "$df"; sed -ri -e "s/amd64 [|] //g" "$df"; ! grep -qE "amd64 [|] " "$df"' \
8+
'
9+
.matrix.include += [
10+
.matrix.include[]
11+
| select(.name | test(" (.+)") | not) # ignore any existing munged builds
12+
| select(.meta.froms[] | test("^debian:|^ubuntu:"))
13+
| .name += " (force deb build)"
14+
| .runs.build = (
15+
[
16+
"# force us to build debs instead of downloading them",
17+
$prefix,
18+
("for df in " + ([ .meta.dockerfiles[] | @sh ] | join(" ")) + "; do " + $dfMunge + "; done"),
19+
.runs.build
20+
] | join ("\n")
21+
)
22+
]
23+
' "$@"

.travis.yml

-48
This file was deleted.

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ For outstanding `postgres` image PRs, check [PRs with the "library/postgres" lab
1414

1515
---
1616

17-
- [![build status badge](https://img.shields.io/travis/docker-library/postgres/master.svg?label=Travis%20CI)](https://travis-ci.org/docker-library/postgres/branches)
18-
- [![build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/update.sh/job/postgres.svg?label=Automated%20update.sh)](https://doi-janky.infosiftr.net/job/update.sh/job/postgres)
17+
- [![build status badge](https://img.shields.io/github/workflow/status/docker-library/postgres/GitHub%20CI/master?label=GitHub%20CI)](https://github.com/docker-library/postgres/actions?query=workflow%3A%22GitHub+CI%22+branch%3Amaster)
18+
- [![build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/update.sh/job/postgres.svg?label=Automated%20update.sh)](https://doi-janky.infosiftr.net/job/update.sh/job/postgres/)
1919

2020
| Build | Status | Badges | (per-arch) |
2121
|:-:|:-:|:-:|:-:|
22-
| [![amd64 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/amd64/job/postgres.svg?label=amd64)](https://doi-janky.infosiftr.net/job/multiarch/job/amd64/job/postgres) | [![arm32v5 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm32v5/job/postgres.svg?label=arm32v5)](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v5/job/postgres) | [![arm32v6 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm32v6/job/postgres.svg?label=arm32v6)](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v6/job/postgres) | [![arm32v7 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm32v7/job/postgres.svg?label=arm32v7)](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v7/job/postgres) |
23-
| [![arm64v8 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm64v8/job/postgres.svg?label=arm64v8)](https://doi-janky.infosiftr.net/job/multiarch/job/arm64v8/job/postgres) | [![i386 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/i386/job/postgres.svg?label=i386)](https://doi-janky.infosiftr.net/job/multiarch/job/i386/job/postgres) | [![ppc64le build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/ppc64le/job/postgres.svg?label=ppc64le)](https://doi-janky.infosiftr.net/job/multiarch/job/ppc64le/job/postgres) | [![s390x build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/s390x/job/postgres.svg?label=s390x)](https://doi-janky.infosiftr.net/job/multiarch/job/s390x/job/postgres) |
24-
| [![put-shared build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/put-shared/job/light/job/postgres.svg?label=put-shared)](https://doi-janky.infosiftr.net/job/put-shared/job/light/job/postgres) |
22+
| [![amd64 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/amd64/job/postgres.svg?label=amd64)](https://doi-janky.infosiftr.net/job/multiarch/job/amd64/job/postgres/) | [![arm32v5 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm32v5/job/postgres.svg?label=arm32v5)](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v5/job/postgres/) | [![arm32v6 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm32v6/job/postgres.svg?label=arm32v6)](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v6/job/postgres/) | [![arm32v7 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm32v7/job/postgres.svg?label=arm32v7)](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v7/job/postgres/) |
23+
| [![arm64v8 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/arm64v8/job/postgres.svg?label=arm64v8)](https://doi-janky.infosiftr.net/job/multiarch/job/arm64v8/job/postgres/) | [![i386 build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/i386/job/postgres.svg?label=i386)](https://doi-janky.infosiftr.net/job/multiarch/job/i386/job/postgres/) | [![mips64le build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/mips64le/job/postgres.svg?label=mips64le)](https://doi-janky.infosiftr.net/job/multiarch/job/mips64le/job/postgres/) | [![ppc64le build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/ppc64le/job/postgres.svg?label=ppc64le)](https://doi-janky.infosiftr.net/job/multiarch/job/ppc64le/job/postgres/) |
24+
| [![s390x build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/multiarch/job/s390x/job/postgres.svg?label=s390x)](https://doi-janky.infosiftr.net/job/multiarch/job/s390x/job/postgres/) | [![put-shared build status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/put-shared/job/light/job/postgres.svg?label=put-shared)](https://doi-janky.infosiftr.net/job/put-shared/job/light/job/postgres/) |
2525

2626
<!-- THIS FILE IS GENERATED BY https://github.com/docker-library/docs/blob/master/generate-repo-stub-readme.sh -->

update.sh

-12
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ if [ ${#versions[@]} -eq 0 ]; then
99
fi
1010
versions=( "${versions[@]%/}" )
1111

12-
# sort version numbers with highest last (so it goes first in .travis.yml)
13-
IFS=$'\n'; versions=( $(echo "${versions[*]}" | sort -V) ); unset IFS
14-
1512
defaultDebianSuite='buster-slim'
1613
declare -A debianSuite=(
1714
# https://github.com/docker-library/postgres/issues/582
@@ -46,7 +43,6 @@ fetch_suite_arches() {
4643
fi
4744
}
4845

49-
travisEnv=
5046
for version in "${versions[@]}"; do
5147
tag="${debianSuite[$version]:-$defaultDebianSuite}"
5248
suite="${tag%%-slim}"
@@ -134,13 +130,5 @@ for version in "${versions[@]}"; do
134130
# JIT / LLVM is only supported in PostgreSQL 11+ (https://github.com/docker-library/postgres/issues/475)
135131
sed -i '/llvm/d' "$version/$variant/Dockerfile"
136132
fi
137-
138-
travisEnv="\n - VERSION=$version VARIANT=$variant$travisEnv"
139133
done
140-
141-
travisEnv="\n - VERSION=$version FORCE_DEB_BUILD=1$travisEnv"
142-
travisEnv="\n - VERSION=$version$travisEnv"
143134
done
144-
145-
travis="$(awk -v 'RS=\n\n' '$1 == "env:" { $0 = "env:'"$travisEnv"'" } { printf "%s%s", $0, RS }' .travis.yml)"
146-
cat <<<"$travis" > .travis.yml

0 commit comments

Comments
 (0)