Browse Source

Merge pull request #1712 from docker-library/github-actions

Add initial GitHub Actions CI
yosifkit 5 years ago
parent
commit
b81c026116

+ 0 - 0
.travis/check-markdownfmt.sh → .ci/check-markdownfmt.sh


+ 14 - 0
.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

+ 0 - 0
.travis/check-required-files.sh → .ci/check-required-files.sh


+ 0 - 0
.travis/check-short.sh → .ci/check-short.sh


+ 1 - 1
.travis/check-ymlfmt.sh → .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

+ 0 - 0
.travis/get-markdownfmt.sh → .ci/get-markdownfmt.sh


+ 43 - 0
.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' }}

+ 0 - 17
.travis.yml

@@ -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

+ 0 - 16
.travis/check-pr-no-readme.sh

@@ -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

+ 2 - 2
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/)