Skip to content

Commit

Permalink
adding github workflow to render docs and lint
Browse files Browse the repository at this point in the history
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 <vsoch@users.noreply.github.com>
  • Loading branch information
7c00d committed Mar 22, 2027
1 parent 8e125f3 commit 1ff2bdb
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 44 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/docs-and-linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Render and Lint Documentation

on:
pull_request:
branches_ignore: []

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
go: ['1.10', '1.11', '1.12']

name: Documentation and Linting
steps:

- uses: actions/checkout@v2
with:
path: go/src/github.com/opencontainers/image-spec

# commit for v1 release
- uses: actions/setup-go@0caeaed6fd66a828038c2da3c0f662a42862658f
with:
go-version: ${{ matrix.go }}

- name: Render and Lint
env:
GOPATH: /home/runner/work/image-spec/image-spec/go
run: |
export PATH=$GOPATH/bin:$PATH
docker pull quay.io/oci/pandoc:1.17.0.3-2.fc25.x86_64
cd go/src/github.com/opencontainers/image-spec
make install.tools
go get -u github.com/alecthomas/gometalinter
gometalinter --install
go get -t -d ./...
ls ../
make
make .gitvalidation
make lint
make check-license
make test
make docs
- name: documentation artifacts
uses: actions/upload-artifact@v2
with:
name: oci-docs
path: go/src/github.com/opencontainers/image-spec/output
30 changes: 0 additions & 30 deletions .travis.yml

This file was deleted.

9 changes: 4 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@ export GO15VENDOREXPERIMENT
DOCKER ?= $(shell command -v docker 2>/dev/null)
PANDOC ?= $(shell command -v pandoc 2>/dev/null)

OUTPUT_DIRNAME ?= output/
OUTPUT_DIRNAME ?= output
DOC_FILENAME ?= oci-image-spec

PANDOC_CONTAINER ?= quay.io/oci/pandoc:1.17.0.3-2.fc25.x86_64
ifeq "$(strip $(PANDOC))" ''
ifneq "$(strip $(DOCKER))" ''
PANDOC = $(DOCKER) run \
-it \
--rm \
-v $(shell pwd)/:/input/:ro \
-v $(shell pwd)/$(OUTPUT_DIRNAME)/:/$(OUTPUT_DIRNAME)/ \
Expand Down Expand Up @@ -107,11 +106,11 @@ img/%.png: img/%.dot
dot -Tpng $^ > $@


# When this is running in travis, it will only check the travis commit range
# When this is running in GitHub, it will only check the commit range
.gitvalidation:
@which git-validation > /dev/null 2>/dev/null || (echo "ERROR: git-validation not found. Consider 'make install.tools' target" && false)
ifdef TRAVIS_COMMIT_RANGE
git-validation -q -run DCO,short-subject,dangling-whitespace
ifdef GITHUB_SHA
git-validation -q -run DCO,short-subject,dangling-whitespace -range $(GITHUB_SHA)..HEAD
else
git-validation -v -run DCO,short-subject,dangling-whitespace -range $(EPOCH_TEST_COMMIT)..HEAD
endif
Expand Down
58 changes: 49 additions & 9 deletions schema/fs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1ff2bdb

Please sign in to comment.