You've already forked postgres
mirror of
https://github.com/docker-library/postgres.git
synced 2025-07-29 21:41:20 +03:00
Add initial GitHub Actions CI
This commit is contained in:
49
.github/workflows/ci.yml
vendored
Normal file
49
.github/workflows/ci.yml
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
name: GitHub CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
schedule:
|
||||
- cron: 0 0 * * 0
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: 'bash -Eeuo pipefail -x {0}'
|
||||
|
||||
jobs:
|
||||
|
||||
generate-jobs:
|
||||
name: Generate Jobs
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
strategy: ${{ steps.generate-jobs.outputs.strategy }}
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- id: generate-jobs
|
||||
name: Generate Jobs
|
||||
run: |
|
||||
git clone --depth 1 https://github.com/docker-library/bashbrew.git -b master ~/bashbrew
|
||||
strategy="$(~/bashbrew/scripts/github-actions/generate.sh)"
|
||||
strategy="$(.github/workflows/munge.sh -c <<<"$strategy")"
|
||||
jq . <<<"$strategy" # sanity check / debugging aid
|
||||
echo "::set-output name=strategy::$strategy"
|
||||
|
||||
test:
|
||||
needs: generate-jobs
|
||||
strategy: ${{ fromJson(needs.generate-jobs.outputs.strategy) }}
|
||||
name: ${{ matrix.name }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Prepare Environment
|
||||
run: ${{ matrix.runs.prepare }}
|
||||
- name: Pull Dependencies
|
||||
run: ${{ matrix.runs.pull }}
|
||||
- name: Build ${{ matrix.name }}
|
||||
run: ${{ matrix.runs.build }}
|
||||
- name: History ${{ matrix.name }}
|
||||
run: ${{ matrix.runs.history }}
|
||||
- name: Test ${{ matrix.name }}
|
||||
run: ${{ matrix.runs.test }}
|
||||
- name: '"docker images"'
|
||||
run: ${{ matrix.runs.images }}
|
23
.github/workflows/munge.sh
vendored
Executable file
23
.github/workflows/munge.sh
vendored
Executable file
@ -0,0 +1,23 @@
|
||||
#!/usr/bin/env bash
|
||||
set -Eeuo pipefail
|
||||
|
||||
# copy all the Debian build jobs into "force deb build" jobs which build like architectures upstream doesn't publish for will
|
||||
jq \
|
||||
--arg prefix '[ "$(dpkg --print-architecture)" = "amd64" ]' \
|
||||
--arg dfMunge 'grep -qE "amd64 [|] " "$df"; sed -ri -e "s/amd64 [|] //g" "$df"; ! grep -qE "amd64 [|] " "$df"' \
|
||||
'
|
||||
.matrix.include += [
|
||||
.matrix.include[]
|
||||
| select(.name | test(" (.+)") | not) # ignore any existing munged builds
|
||||
| select(.meta.froms[] | test("^debian:|^ubuntu:"))
|
||||
| .name += " (force deb build)"
|
||||
| .runs.build = (
|
||||
[
|
||||
"# force us to build debs instead of downloading them",
|
||||
$prefix,
|
||||
("for df in " + ([ .meta.dockerfiles[] | @sh ] | join(" ")) + "; do " + $dfMunge + "; done"),
|
||||
.runs.build
|
||||
] | join ("\n")
|
||||
)
|
||||
]
|
||||
' "$@"
|
48
.travis.yml
48
.travis.yml
@ -1,48 +0,0 @@
|
||||
language: bash
|
||||
services: docker
|
||||
|
||||
env:
|
||||
- VERSION=12
|
||||
- VERSION=12 FORCE_DEB_BUILD=1
|
||||
- VERSION=12 VARIANT=alpine
|
||||
- VERSION=11
|
||||
- VERSION=11 FORCE_DEB_BUILD=1
|
||||
- VERSION=11 VARIANT=alpine
|
||||
- VERSION=10
|
||||
- VERSION=10 FORCE_DEB_BUILD=1
|
||||
- VERSION=10 VARIANT=alpine
|
||||
- VERSION=9.6
|
||||
- VERSION=9.6 FORCE_DEB_BUILD=1
|
||||
- VERSION=9.6 VARIANT=alpine
|
||||
- VERSION=9.5
|
||||
- VERSION=9.5 FORCE_DEB_BUILD=1
|
||||
- VERSION=9.5 VARIANT=alpine
|
||||
|
||||
install:
|
||||
- git clone https://github.com/docker-library/official-images.git ~/official-images
|
||||
|
||||
before_script:
|
||||
- env | sort
|
||||
- wget -qO- 'https://github.com/tianon/pgp-happy-eyeballs/raw/master/hack-my-builds.sh' | bash
|
||||
- cd "$VERSION/$VARIANT"
|
||||
- image="postgres:${VERSION}${VARIANT:+-${VARIANT}}"
|
||||
|
||||
script:
|
||||
- |
|
||||
(
|
||||
set -Eeuo pipefail
|
||||
set -x
|
||||
if [ -n "${FORCE_DEB_BUILD:+x}" ]; then
|
||||
[ "$(dpkg --print-architecture)" = 'amd64' ]
|
||||
grep -qE 'amd64 [|] ' Dockerfile
|
||||
sed -ri -e 's/amd64 [|] //g' Dockerfile
|
||||
! grep -qE 'amd64 [|] ' Dockerfile
|
||||
fi
|
||||
docker build -t "$image" .
|
||||
~/official-images/test/run.sh "$image"
|
||||
)
|
||||
|
||||
after_script:
|
||||
- docker images
|
||||
|
||||
# vim:set et ts=2 sw=2:
|
10
README.md
10
README.md
@ -14,13 +14,13 @@ For outstanding `postgres` image PRs, check [PRs with the "library/postgres" lab
|
||||
|
||||
---
|
||||
|
||||
- [](https://travis-ci.org/docker-library/postgres/branches)
|
||||
- [](https://doi-janky.infosiftr.net/job/update.sh/job/postgres)
|
||||
- [](https://github.com/docker-library/postgres/actions?query=workflow%3A%22GitHub+CI%22+branch%3Amaster)
|
||||
- [](https://doi-janky.infosiftr.net/job/update.sh/job/postgres/)
|
||||
|
||||
| Build | Status | Badges | (per-arch) |
|
||||
|:-:|:-:|:-:|:-:|
|
||||
| [](https://doi-janky.infosiftr.net/job/multiarch/job/amd64/job/postgres) | [](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v5/job/postgres) | [](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v6/job/postgres) | [](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v7/job/postgres) |
|
||||
| [](https://doi-janky.infosiftr.net/job/multiarch/job/arm64v8/job/postgres) | [](https://doi-janky.infosiftr.net/job/multiarch/job/i386/job/postgres) | [](https://doi-janky.infosiftr.net/job/multiarch/job/ppc64le/job/postgres) | [](https://doi-janky.infosiftr.net/job/multiarch/job/s390x/job/postgres) |
|
||||
| [](https://doi-janky.infosiftr.net/job/put-shared/job/light/job/postgres) |
|
||||
| [](https://doi-janky.infosiftr.net/job/multiarch/job/amd64/job/postgres/) | [](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v5/job/postgres/) | [](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v6/job/postgres/) | [](https://doi-janky.infosiftr.net/job/multiarch/job/arm32v7/job/postgres/) |
|
||||
| [](https://doi-janky.infosiftr.net/job/multiarch/job/arm64v8/job/postgres/) | [](https://doi-janky.infosiftr.net/job/multiarch/job/i386/job/postgres/) | [](https://doi-janky.infosiftr.net/job/multiarch/job/mips64le/job/postgres/) | [](https://doi-janky.infosiftr.net/job/multiarch/job/ppc64le/job/postgres/) |
|
||||
| [](https://doi-janky.infosiftr.net/job/multiarch/job/s390x/job/postgres/) | [](https://doi-janky.infosiftr.net/job/put-shared/job/light/job/postgres/) |
|
||||
|
||||
<!-- THIS FILE IS GENERATED BY https://github.com/docker-library/docs/blob/master/generate-repo-stub-readme.sh -->
|
||||
|
12
update.sh
12
update.sh
@ -9,9 +9,6 @@ if [ ${#versions[@]} -eq 0 ]; then
|
||||
fi
|
||||
versions=( "${versions[@]%/}" )
|
||||
|
||||
# sort version numbers with highest last (so it goes first in .travis.yml)
|
||||
IFS=$'\n'; versions=( $(echo "${versions[*]}" | sort -V) ); unset IFS
|
||||
|
||||
defaultDebianSuite='buster-slim'
|
||||
declare -A debianSuite=(
|
||||
# https://github.com/docker-library/postgres/issues/582
|
||||
@ -46,7 +43,6 @@ fetch_suite_arches() {
|
||||
fi
|
||||
}
|
||||
|
||||
travisEnv=
|
||||
for version in "${versions[@]}"; do
|
||||
tag="${debianSuite[$version]:-$defaultDebianSuite}"
|
||||
suite="${tag%%-slim}"
|
||||
@ -134,13 +130,5 @@ for version in "${versions[@]}"; do
|
||||
# JIT / LLVM is only supported in PostgreSQL 11+ (https://github.com/docker-library/postgres/issues/475)
|
||||
sed -i '/llvm/d' "$version/$variant/Dockerfile"
|
||||
fi
|
||||
|
||||
travisEnv="\n - VERSION=$version VARIANT=$variant$travisEnv"
|
||||
done
|
||||
|
||||
travisEnv="\n - VERSION=$version FORCE_DEB_BUILD=1$travisEnv"
|
||||
travisEnv="\n - VERSION=$version$travisEnv"
|
||||
done
|
||||
|
||||
travis="$(awk -v 'RS=\n\n' '$1 == "env:" { $0 = "env:'"$travisEnv"'" } { printf "%s%s", $0, RS }' .travis.yml)"
|
||||
cat <<<"$travis" > .travis.yml
|
||||
|
Reference in New Issue
Block a user