Skip to content
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

Merged
merged 1 commit into from
May 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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']
Copy link
Member

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


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
Copy link
Member

Choose a reason for hiding this comment

The 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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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
Copy link
Member

Choose a reason for hiding this comment

The 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

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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
Copy link
Contributor

Choose a reason for hiding this comment

The 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

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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:

- 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, this ought to be tracked in git-validation.
vbatts/git-validation#48

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.