Skip to content

Commit

Permalink
Merge pull request #284 from bloodorangeio/github-actions
Browse files Browse the repository at this point in the history
Move from Travis to GitHub Actions
  • Loading branch information
dmcgowan authored Jun 23, 2021
2 parents e632d5a + 5520b6b commit 524a53f
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 24 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
@@ -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
23 changes: 23 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
output
header.html
tags
go.mod
go.sum
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)/ \
Expand All @@ -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 \
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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).**
Expand Down

0 comments on commit 524a53f

Please sign in to comment.