Skip to content

Commit ad9cc95

Browse files
committed
Move from Travis to GitHub Actions
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
1 parent e632d5a commit ad9cc95

8 files changed

Lines changed: 58 additions & 26 deletions

File tree

.github/workflows/build-pr.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: build-pr
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
run:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: checkout source code
13+
uses: actions/checkout@master
14+
- name: setup go environment
15+
uses: actions/setup-go@v1
16+
with:
17+
go-version: '1.16.5'
18+
- name: run tests
19+
run: |
20+
export PATH="$(go env GOPATH)/bin:${PATH}"
21+
make install.tools
22+
make .gitvalidation
23+
make docs conformance

.github/workflows/build.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
run:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: checkout source code
13+
uses: actions/checkout@master
14+
- name: setup go environment
15+
uses: actions/setup-go@v1
16+
with:
17+
go-version: '1.16.5'
18+
- name: run tests
19+
run: |
20+
export PATH="$(go env GOPATH)/bin:${PATH}"
21+
make install.tools
22+
make .gitvalidation
23+
make docs conformance

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
output
44
header.html
55
tags
6+
go.mod
7+
go.sum

.tool/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module github.com/opencontainers/distribution-spec/.tool
22

3-
go 1.15
3+
go 1.16
44

55
require github.com/opencontainers/distribution-spec/specs-go v0.0.0-20210623213441-eb171947459c // indirect

.travis.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ PANDOC_CONTAINER ?= ghcr.io/opencontainers/pandoc:2.9.2.1-8.fc33.x86_64@sha256:5
1212
ifeq "$(strip $(PANDOC))" ''
1313
ifneq "$(strip $(DOCKER))" ''
1414
PANDOC = $(DOCKER) run \
15-
-it \
1615
--rm \
1716
-v $(shell pwd)/:/input/:ro \
1817
-v $(shell pwd)/$(OUTPUT_DIRNAME)/:/$(OUTPUT_DIRNAME)/ \
@@ -28,7 +27,6 @@ GOLANGCILINT_CONTAINER ?= ghcr.io/opencontainers/golangci-lint:v1.39.0@sha256:7b
2827
ifeq "$(strip $(GOLANGCILINT))" ''
2928
ifneq "$(strip $(DOCKER))" ''
3029
GOLANGCILINT = $(DOCKER) run \
31-
-it \
3230
--rm \
3331
-v $(shell pwd)/:/input:ro \
3432
-e GOCACHE=/tmp/.cache \
@@ -48,11 +46,11 @@ FIGURE_FILES :=
4846

4947
test: .gitvalidation
5048

51-
# When this is running in travis, it will only check the travis commit range
49+
# When this is running in GitHub, it will only check the GitHub commit range
5250
.gitvalidation:
5351
@command -v git-validation >/dev/null 2>/dev/null || (echo "ERROR: git-validation not found. Consider 'make install.tools' target" && false)
54-
ifdef TRAVIS_COMMIT_RANGE
55-
git-validation -q -run DCO,short-subject,dangling-whitespace
52+
ifdef GITHUB_SHA
53+
git-validation -q -run DCO,short-subject,dangling-whitespace -range $(GITHUB_SHA)..HEAD
5654
else
5755
git-validation -v -run DCO,short-subject,dangling-whitespace -range $(EPOCH_TEST_COMMIT)..HEAD
5856
endif
@@ -76,7 +74,9 @@ $(OUTPUT_DIRNAME)/$(DOC_FILENAME).html: header.html $(DOC_FILES) $(FIGURE_FILES)
7674
endif
7775

7876
header.html: .tool/genheader.go specs-go/version.go
79-
go mod init && \
77+
rm -f go.mod go.sum && \
78+
go mod init github.com/opencontainers/distribution-spec && \
79+
go get github.com/opencontainers/distribution-spec/specs-go && \
8080
go run .tool/genheader.go > $@
8181

8282
install.tools: .install.gitvalidation

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# OCI Distribution Specification
22

3+
[![GitHub Actions status](https://github.com/opencontainers/distribution-spec/workflows/build/badge.svg)](https://github.com/opencontainers/distribution-spec/actions?query=workflow%3Abuild)
4+
35
The OCI Distribution Spec project defines an API protocol to facilitate and standardize the distribution of content.
46

57
**[The specification can be found here](spec.md).**

specs-go/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module github.com/opencontainers/distribution-spec/specs-go
22

3-
go 1.15
3+
go 1.16

0 commit comments

Comments
 (0)