From a3d3e7f32460b1a06ead71640eba635de640446c Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Thu, 30 Apr 2020 17:44:40 -0700 Subject: [PATCH] Add initial GitHub Actions CI --- {.travis => .ci}/check-markdownfmt.sh | 0 .ci/check-pr-no-readme.sh | 14 ++++++++ {.travis => .ci}/check-required-files.sh | 0 {.travis => .ci}/check-short.sh | 0 {.travis => .ci}/check-ymlfmt.sh | 2 +- {.travis => .ci}/get-markdownfmt.sh | 0 .github/workflows/ci.yml | 43 ++++++++++++++++++++++++ .travis.yml | 17 ---------- .travis/check-pr-no-readme.sh | 16 --------- README.md | 4 +-- 10 files changed, 60 insertions(+), 36 deletions(-) rename {.travis => .ci}/check-markdownfmt.sh (100%) create mode 100755 .ci/check-pr-no-readme.sh rename {.travis => .ci}/check-required-files.sh (100%) rename {.travis => .ci}/check-short.sh (100%) rename {.travis => .ci}/check-ymlfmt.sh (86%) rename {.travis => .ci}/get-markdownfmt.sh (100%) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml delete mode 100755 .travis/check-pr-no-readme.sh diff --git a/.travis/check-markdownfmt.sh b/.ci/check-markdownfmt.sh similarity index 100% rename from .travis/check-markdownfmt.sh rename to .ci/check-markdownfmt.sh diff --git a/.ci/check-pr-no-readme.sh b/.ci/check-pr-no-readme.sh new file mode 100755 index 000000000000..6ffe4f25b03c --- /dev/null +++ b/.ci/check-pr-no-readme.sh @@ -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 diff --git a/.travis/check-required-files.sh b/.ci/check-required-files.sh similarity index 100% rename from .travis/check-required-files.sh rename to .ci/check-required-files.sh diff --git a/.travis/check-short.sh b/.ci/check-short.sh similarity index 100% rename from .travis/check-short.sh rename to .ci/check-short.sh diff --git a/.travis/check-ymlfmt.sh b/.ci/check-ymlfmt.sh similarity index 86% rename from .travis/check-ymlfmt.sh rename to .ci/check-ymlfmt.sh index 82cffb1d08f2..5315948d9a0b 100755 --- a/.travis/check-ymlfmt.sh +++ b/.ci/check-ymlfmt.sh @@ -3,7 +3,7 @@ set -Eeuo pipefail cd "$(dirname "$(readlink -f "$BASH_SOURCE")")/.." -files="$(find -name '*.yml')" +files="$(find -name '*.yml' -not -path './.github/*')" need=() needdiff= for f in $files; do diff --git a/.travis/get-markdownfmt.sh b/.ci/get-markdownfmt.sh similarity index 100% rename from .travis/get-markdownfmt.sh rename to .ci/get-markdownfmt.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000000..3c42274bd017 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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' }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7aef89c68e2a..000000000000 --- a/.travis.yml +++ /dev/null @@ -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 diff --git a/.travis/check-pr-no-readme.sh b/.travis/check-pr-no-readme.sh deleted file mode 100755 index 010854117ec8..000000000000 --- a/.travis/check-pr-no-readme.sh +++ /dev/null @@ -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 diff --git a/README.md b/README.md index 7969d3394e8a..52fb627f70c3 100644 --- a/README.md +++ b/README.md @@ -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. -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/) - [![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/)