Add initial GitHub Actions CI

This commit is contained in:
Tianon Gravi 2020-04-30 17:44:40 -07:00
parent a49d5469e0
commit a3d3e7f324
10 changed files with 60 additions and 36 deletions

14
.ci/check-pr-no-readme.sh Executable file
View File

@ -0,0 +1,14 @@
#!/usr/bin/env bash
set -Eeuo pipefail
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")/.."
git fetch -q https://github.com/docker-library/docs.git master
if [ -n "$(git diff --numstat FETCH_HEAD...HEAD -- '*/README.md')" ]; then
echo >&2 'Error: at least one repo README.md has changed'
echo >&2 'These files are autogenerated, so it is unnecessary to modify them'
echo >&2 'Please update content.md and docker-library-bot will take care of README.md'
echo >&2 'See: https://github.com/docker-library/docs/#image-namereadmemd'
echo >&2
exit 1
fi

View File

@ -3,7 +3,7 @@ set -Eeuo pipefail
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")/.." cd "$(dirname "$(readlink -f "$BASH_SOURCE")")/.."
files="$(find -name '*.yml')" files="$(find -name '*.yml' -not -path './.github/*')"
need=() need=()
needdiff= needdiff=
for f in $files; do for f in $files; do

43
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,43 @@
name: GitHub CI
on:
pull_request:
push:
branches:
- master
schedule:
- cron: 0 0 * * 0
defaults:
run:
shell: 'bash -Eeuo pipefail -x {0}'
jobs:
markdownfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: docker pull tianon/markdownfmt
- run: .ci/check-markdownfmt.sh
ymlfmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: docker pull tianon/ymlfmt
- run: .ci/check-ymlfmt.sh
short:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: .ci/check-short.sh
required-files:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: .ci/check-required-files.sh
no-readme:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: .ci/check-pr-no-readme.sh
if: ${{ github.event_name == 'pull_request' }}

View File

@ -1,17 +0,0 @@
branches:
only:
- master
language: bash
services: docker
install:
- docker pull tianon/markdownfmt
- docker pull tianon/ymlfmt
script:
- .travis/check-markdownfmt.sh
- .travis/check-ymlfmt.sh
- .travis/check-short.sh
- .travis/check-required-files.sh
- .travis/check-pr-no-readme.sh

View File

@ -1,16 +0,0 @@
#!/usr/bin/env bash
set -Eeuo pipefail
cd "$(dirname "$(readlink -f "$BASH_SOURCE")")/.."
if [ "$TRAVIS_PULL_REQUEST" != 'false' ]; then
git fetch -q https://github.com/docker-library/docs.git master
if [ -n "$(git diff --numstat FETCH_HEAD...HEAD -- '*/README.md')" ]; then
echo >&2 'Error: at least one repo README.md has changed'
echo >&2 'These files are autogenerated, so it is unnecessary to modify them'
echo >&2 'Please update content.md and docker-library-bot will take care of README.md'
echo >&2 'See: https://github.com/docker-library/docs/#image-namereadmemd'
echo >&2
exit 1
fi
fi

View File

@ -2,9 +2,9 @@
This repository contains the image documentation for each of the official images. See [docker-library/official-images](https://github.com/docker-library/official-images) for more information about the program in general. This repository contains the image documentation for each of the official images. See [docker-library/official-images](https://github.com/docker-library/official-images) for more information about the program in general.
All Markdown files here are run through [tianon's fork of `markdownfmt`](https://github.com/tianon/markdownfmt) (only forked to add some smaller-diff preference and minor DockerHub-compatibility changes), and verified as formatted correctly via Travis CI. All Markdown files here are run through [tianon's fork of `markdownfmt`](https://github.com/tianon/markdownfmt) (only forked to add some smaller-diff preference and minor DockerHub-compatibility changes), and verified as formatted correctly via GitHub Actions.
- [![Travis CI status badge](https://img.shields.io/travis/docker-library/docs/master.svg?label=Travis%20CI)](https://travis-ci.org/docker-library/docs) - [![GitHub CI status badge](https://img.shields.io/github/workflow/status/docker-library/docs/GitHub%20CI/master?label=GitHub%20CI)](https://github.com/docker-library/docs/actions?query=workflow%3A%22GitHub+CI%22+branch%3Amaster)
- [![library update.sh status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/docs/job/library.svg?label=Automated%20library%20update.sh)](https://doi-janky.infosiftr.net/job/docs/job/library/) - [![library update.sh status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/docs/job/library.svg?label=Automated%20library%20update.sh)](https://doi-janky.infosiftr.net/job/docs/job/library/)
- [![amd64 update.sh status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/docs/job/amd64.svg?label=Automated%20amd64%20update.sh)](https://doi-janky.infosiftr.net/job/docs/job/amd64/) - [![amd64 update.sh status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/docs/job/amd64.svg?label=Automated%20amd64%20update.sh)](https://doi-janky.infosiftr.net/job/docs/job/amd64/)
- [![arm32v5 update.sh status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/docs/job/arm32v5.svg?label=Automated%20arm32v5%20update.sh)](https://doi-janky.infosiftr.net/job/docs/job/arm32v5/) - [![arm32v5 update.sh status badge](https://img.shields.io/jenkins/s/https/doi-janky.infosiftr.net/job/docs/job/arm32v5.svg?label=Automated%20arm32v5%20update.sh)](https://doi-janky.infosiftr.net/job/docs/job/arm32v5/)