From ad9cc952787ea4a972883a32b96a886e8a0b5fb6 Mon Sep 17 00:00:00 2001 From: Josh Dolitsky Date: Wed, 23 Jun 2021 18:49:34 -0400 Subject: [PATCH 1/3] Move from Travis to GitHub Actions Signed-off-by: Josh Dolitsky --- .github/workflows/build-pr.yml | 23 +++++++++++++++++++++++ .github/workflows/build.yml | 23 +++++++++++++++++++++++ .gitignore | 2 ++ .tool/go.mod | 2 +- .travis.yml | 18 ------------------ Makefile | 12 ++++++------ README.md | 2 ++ specs-go/go.mod | 2 +- 8 files changed, 58 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/build-pr.yml create mode 100644 .github/workflows/build.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml new file mode 100644 index 00000000..5e8b7770 --- /dev/null +++ b/.github/workflows/build-pr.yml @@ -0,0 +1,23 @@ +name: build-pr + +on: + pull_request: + branches: + - main + +jobs: + run: + runs-on: ubuntu-latest + steps: + - name: checkout source code + uses: actions/checkout@master + - name: setup go environment + uses: actions/setup-go@v1 + with: + go-version: '1.16.5' + - name: run tests + run: | + export PATH="$(go env GOPATH)/bin:${PATH}" + make install.tools + make .gitvalidation + make docs conformance diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..03b98f97 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,23 @@ +name: build + +on: + push: + branches: + - main + +jobs: + run: + runs-on: ubuntu-latest + steps: + - name: checkout source code + uses: actions/checkout@master + - name: setup go environment + uses: actions/setup-go@v1 + with: + go-version: '1.16.5' + - name: run tests + run: | + export PATH="$(go env GOPATH)/bin:${PATH}" + make install.tools + make .gitvalidation + make docs conformance diff --git a/.gitignore b/.gitignore index ed66dcd3..a5e59405 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ output header.html tags +go.mod +go.sum \ No newline at end of file diff --git a/.tool/go.mod b/.tool/go.mod index cfae70c1..cb5f771f 100644 --- a/.tool/go.mod +++ b/.tool/go.mod @@ -1,5 +1,5 @@ module github.com/opencontainers/distribution-spec/.tool -go 1.15 +go 1.16 require github.com/opencontainers/distribution-spec/specs-go v0.0.0-20210623213441-eb171947459c // indirect diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 57c04502..00000000 --- a/.travis.yml +++ /dev/null @@ -1,18 +0,0 @@ -language: go -go: - - 1.15.x - -sudo: required - -services: - - docker - -before_install: - - make install.tools - -install: true - -script: - - echo "${TRAVIS_COMMIT_RANGE} -> ${TRAVIS_COMMIT_RANGE/.../..} (travis-ci/travis-ci#4596)" - - TRAVIS_COMMIT_RANGE="${TRAVIS_COMMIT_RANGE/.../..}" make .gitvalidation - - make docs conformance diff --git a/Makefile b/Makefile index 2b5c8578..24db650a 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,6 @@ PANDOC_CONTAINER ?= ghcr.io/opencontainers/pandoc:2.9.2.1-8.fc33.x86_64@sha256:5 ifeq "$(strip $(PANDOC))" '' ifneq "$(strip $(DOCKER))" '' PANDOC = $(DOCKER) run \ - -it \ --rm \ -v $(shell pwd)/:/input/:ro \ -v $(shell pwd)/$(OUTPUT_DIRNAME)/:/$(OUTPUT_DIRNAME)/ \ @@ -28,7 +27,6 @@ GOLANGCILINT_CONTAINER ?= ghcr.io/opencontainers/golangci-lint:v1.39.0@sha256:7b ifeq "$(strip $(GOLANGCILINT))" '' ifneq "$(strip $(DOCKER))" '' GOLANGCILINT = $(DOCKER) run \ - -it \ --rm \ -v $(shell pwd)/:/input:ro \ -e GOCACHE=/tmp/.cache \ @@ -48,11 +46,11 @@ FIGURE_FILES := test: .gitvalidation -# 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 GitHub commit range .gitvalidation: @command -v 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 @@ -76,7 +74,9 @@ $(OUTPUT_DIRNAME)/$(DOC_FILENAME).html: header.html $(DOC_FILES) $(FIGURE_FILES) endif header.html: .tool/genheader.go specs-go/version.go - go mod init && \ + rm -f go.mod go.sum && \ + go mod init github.com/opencontainers/distribution-spec && \ + go get github.com/opencontainers/distribution-spec/specs-go && \ go run .tool/genheader.go > $@ install.tools: .install.gitvalidation diff --git a/README.md b/README.md index 25a8583f..e7334091 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # OCI Distribution Specification +[![GitHub Actions status](https://github.com/opencontainers/distribution-spec/workflows/build/badge.svg)](https://github.com/opencontainers/distribution-spec/actions?query=workflow%3Abuild) + The OCI Distribution Spec project defines an API protocol to facilitate and standardize the distribution of content. **[The specification can be found here](spec.md).** diff --git a/specs-go/go.mod b/specs-go/go.mod index 5f2ed1d8..4fddc031 100644 --- a/specs-go/go.mod +++ b/specs-go/go.mod @@ -1,3 +1,3 @@ module github.com/opencontainers/distribution-spec/specs-go -go 1.15 +go 1.16 From 028a295df6524cf8884c409ec121a5c32257608a Mon Sep 17 00:00:00 2001 From: Josh Dolitsky Date: Wed, 23 Jun 2021 19:05:51 -0400 Subject: [PATCH 2/3] Add newline to bottom of .gitignore Signed-off-by: Josh Dolitsky --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index a5e59405..630f94c7 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,4 @@ output header.html tags go.mod -go.sum \ No newline at end of file +go.sum From 5520b6b23e70eb96ac35f0a063fd2cf839eebeec Mon Sep 17 00:00:00 2001 From: Josh Dolitsky Date: Wed, 23 Jun 2021 19:21:39 -0400 Subject: [PATCH 3/3] use Go 1.15 as minimum version Signed-off-by: Josh Dolitsky --- .tool/go.mod | 2 +- specs-go/go.mod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.tool/go.mod b/.tool/go.mod index cb5f771f..cfae70c1 100644 --- a/.tool/go.mod +++ b/.tool/go.mod @@ -1,5 +1,5 @@ module github.com/opencontainers/distribution-spec/.tool -go 1.16 +go 1.15 require github.com/opencontainers/distribution-spec/specs-go v0.0.0-20210623213441-eb171947459c // indirect diff --git a/specs-go/go.mod b/specs-go/go.mod index 4fddc031..5f2ed1d8 100644 --- a/specs-go/go.mod +++ b/specs-go/go.mod @@ -1,3 +1,3 @@ module github.com/opencontainers/distribution-spec/specs-go -go 1.16 +go 1.15