Skip to content

Commit 9ed9683

Browse files
committed
adding github workflow to render docs and lint
This should be equivalent to the .travis-ci workflow, but run in GitHub actions. I am using the exact commit of the v1 release, as that is considered safer practice than the tag/release itself. Signed-off-by: vsoch <[email protected]>
1 parent 4518cd4 commit 9ed9683

File tree

4 files changed

+102
-44
lines changed

4 files changed

+102
-44
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Render and Lint Documentation
2+
3+
on:
4+
pull_request:
5+
branches_ignore: []
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
go: ['1.10', '1.11', '1.12']
13+
14+
name: Documentation and Linting
15+
steps:
16+
17+
- uses: actions/checkout@v2
18+
with:
19+
path: go/src/github.com/opencontainers/image-spec
20+
21+
# commit for v1 release
22+
- uses: actions/setup-go@0caeaed6fd66a828038c2da3c0f662a42862658f
23+
with:
24+
go-version: ${{ matrix.go }}
25+
26+
- name: Render and Lint
27+
env:
28+
GOPATH: /home/runner/work/image-spec/image-spec/go
29+
run: |
30+
export PATH=$GOPATH/bin:$PATH
31+
docker pull quay.io/oci/pandoc:1.17.0.3-2.fc25.x86_64
32+
cd go/src/github.com/opencontainers/image-spec
33+
make install.tools
34+
go get -u github.com/alecthomas/gometalinter
35+
gometalinter --install
36+
go get -t -d ./...
37+
ls ../
38+
make
39+
make .gitvalidation
40+
make lint
41+
make check-license
42+
make test
43+
make docs
44+
45+
- name: documentation artifacts
46+
uses: actions/upload-artifact@v2
47+
with:
48+
name: oci-docs
49+
path: go/src/github.com/opencontainers/image-spec/output

.travis.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

Makefile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ export GO15VENDOREXPERIMENT
44
DOCKER ?= $(shell command -v docker 2>/dev/null)
55
PANDOC ?= $(shell command -v pandoc 2>/dev/null)
66

7-
OUTPUT_DIRNAME ?= output/
7+
OUTPUT_DIRNAME ?= output
88
DOC_FILENAME ?= oci-image-spec
99

1010
PANDOC_CONTAINER ?= quay.io/oci/pandoc:1.17.0.3-2.fc25.x86_64
1111
ifeq "$(strip $(PANDOC))" ''
1212
ifneq "$(strip $(DOCKER))" ''
1313
PANDOC = $(DOCKER) run \
14-
-it \
1514
--rm \
1615
-v $(shell pwd)/:/input/:ro \
1716
-v $(shell pwd)/$(OUTPUT_DIRNAME)/:/$(OUTPUT_DIRNAME)/ \
@@ -107,11 +106,11 @@ img/%.png: img/%.dot
107106
dot -Tpng $^ > $@
108107

109108

110-
# When this is running in travis, it will only check the travis commit range
109+
# When this is running in GitHub, it will only check the commit range
111110
.gitvalidation:
112111
@which git-validation > /dev/null 2>/dev/null || (echo "ERROR: git-validation not found. Consider 'make install.tools' target" && false)
113-
ifdef TRAVIS_COMMIT_RANGE
114-
git-validation -q -run DCO,short-subject,dangling-whitespace
112+
ifdef GITHUB_SHA
113+
git-validation -q -run DCO,short-subject,dangling-whitespace -range $(GITHUB_SHA)..HEAD
115114
else
116115
git-validation -v -run DCO,short-subject,dangling-whitespace -range $(EPOCH_TEST_COMMIT)..HEAD
117116
endif

schema/fs.go

Lines changed: 49 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)