-
Notifications
You must be signed in to change notification settings - Fork 666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding github workflow to render docs and lint #848
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. wait, this isn't for the image-spec v1, but some github action's release? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I am using the full commit because it’s safer than even a tag or release. https://github.community/t/are-github-actions-safe-to-use/17895/2 |
||||
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 | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we'll have to remember to change this to the new image (https://github.com/opencontainers/distribution-spec/blob/main/Makefile#L11) once #846 merges There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yep I saw that! If someone doesn't beat me to it, I'll follow #846 and can come back and PR to update the image in this workflow. |
||||
cd go/src/github.com/opencontainers/image-spec | ||||
make install.tools | ||||
go get -u github.com/alecthomas/gometalinter | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. seems like this could just be moved into its own install.gometalinter target There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The goal was to reproduce the current CI, and making this call directly is exactly what it does: Line 18 in 450f12c
|
||||
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 |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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)/ \ | ||
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ah, this ought to be tracked in git-validation. |
||
else | ||
git-validation -v -run DCO,short-subject,dangling-whitespace -range $(EPOCH_TEST_COMMIT)..HEAD | ||
endif | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these old versions are fine for first pass at parity. We can add the newer golang versions later