-
Notifications
You must be signed in to change notification settings - Fork 663
56 lines (48 loc) · 1.71 KB
/
docs-and-linting.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Render and Lint Documentation
on:
pull_request:
branches_ignore: []
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
# current Go releases plus the version in the go.mod are tested
go: ['go.mod', 'oldstable', 'stable']
# https://github.com/actions/setup-go/tree/v5#getting-go-version-from-the-gomod-file
# https://github.com/actions/setup-go/tree/v5#using-stableoldstable-aliases
env:
RELEASE_GO_VER: "1.23"
name: Documentation and Linting
steps:
- uses: actions/checkout@v4
with:
path: go/src/github.com/opencontainers/image-spec
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go != 'go.mod' && matrix.go || null }}
go-version-file: ${{ matrix.go == 'go.mod' && 'go/src/github.com/opencontainers/image-spec/go.mod' || null }}
cache-dependency-path: go/src/github.com/opencontainers/image-spec/go.sum
- name: Render and Lint
env:
GOPATH: /home/runner/work/image-spec/image-spec/go
# do not automatically upgrade go to a different version: https://go.dev/doc/toolchain
GOTOOLCHAIN: local
run: |
export PATH=$GOPATH/bin:$PATH
cd go/src/github.com/opencontainers/image-spec
make install.tools
go get -t -d ./...
ls ../
make
make .gitvalidation
make lint
make check-license
make test
make docs
- name: documentation artifacts
uses: actions/upload-artifact@v4
if: matrix.go == env.RELEASE_GO_VER
with:
name: oci-docs
path: go/src/github.com/opencontainers/image-spec/output