Skip to content

Commit 8c3ce1b

Browse files
committed
Update CI to use GitHub Actions
Intent to migrate from Travis CI to GH Actions; will turn off Travis CI once actions are validated as operating properly. Signed-off-by: Phil Estes <[email protected]>
1 parent 6629113 commit 8c3ce1b

3 files changed

Lines changed: 135 additions & 4 deletions

File tree

.github/workflows/ci.yml

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
name: Continuity
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
11+
checks:
12+
name: CI Checks
13+
runs-on: ubuntu-18.04
14+
timeout-minutes: 5
15+
steps:
16+
17+
- name: Set up Go
18+
uses: actions/setup-go@v1
19+
with:
20+
go-version: 1.13
21+
id: go
22+
23+
- name: Setup Go binary path
24+
shell: bash
25+
run: |
26+
echo "::set-env name=GOPATH::${{ github.workspace }}"
27+
echo "::add-path::${{ github.workspace }}/bin"
28+
29+
- name: Check out code
30+
uses: actions/checkout@v2
31+
with:
32+
path: src/github.com/containerd/continuity
33+
fetch-depth: 25
34+
35+
- name: Checkout project
36+
uses: actions/checkout@v2
37+
with:
38+
repository: containerd/project
39+
path: src/github.com/containerd/project
40+
41+
- name: Install dependencies
42+
env:
43+
GO111MODULE: off
44+
run: |
45+
go get -u github.com/vbatts/git-validation
46+
go get -u github.com/kunalkushwaha/ltag
47+
48+
- name: Check DCO/whitespace/commit message
49+
env:
50+
GITHUB_COMMIT_URL: ${{ github.event.pull_request.commits_url }}
51+
DCO_VERBOSITY: "-q"
52+
DCO_RANGE: ""
53+
working-directory: src/github.com/containerd/continuity
54+
run: |
55+
if [ -z "${GITHUB_COMMIT_URL}" ]; then
56+
DCO_RANGE=$(jq -r '.before +".."+ .after' ${GITHUB_EVENT_PATH})
57+
else
58+
DCO_RANGE=$(curl ${GITHUB_COMMIT_URL} | jq -r '.[0].parents[0].sha +".."+ .[-1].sha')
59+
fi
60+
../project/script/validate/dco
61+
62+
- name: Check file headers
63+
run: ../project/script/validate/fileheader ../project/
64+
working-directory: src/github.com/containerd/continuity
65+
66+
- name: Check vendor
67+
run: ../project/script/validate/vendor
68+
working-directory: src/github.com/containerd/continuity
69+
70+
tests:
71+
name: CI Tests
72+
runs-on: ${{ matrix.os }}
73+
timeout-minutes: 10
74+
needs: [checks]
75+
76+
strategy:
77+
matrix:
78+
os: [ubuntu-18.04, macos-10.15, windows-2019]
79+
80+
steps:
81+
- name: Set up Go
82+
uses: actions/setup-go@v1
83+
with:
84+
go-version: 1.13
85+
86+
- name: Setup Go binary path
87+
shell: bash
88+
run: |
89+
echo "::set-env name=GOPATH::${{ github.workspace }}"
90+
echo "::add-path::${{ github.workspace }}/bin"
91+
92+
- name: Git line endings
93+
shell: bash
94+
run: |
95+
git config --global core.autocrlf false
96+
git config --global core.eol lf
97+
98+
- name: Check out code
99+
uses: actions/checkout@v2
100+
with:
101+
path: src/github.com/containerd/continuity
102+
fetch-depth: 25
103+
104+
- name: Dependencies
105+
env:
106+
GO111MODULE: on
107+
shell: bash
108+
run: go get github.com/golangci/golangci-lint/cmd/[email protected]
109+
110+
- name: Lint
111+
shell: bash
112+
run: make lint
113+
working-directory: src/github.com/containerd/continuity
114+
115+
- name: Build
116+
shell: bash
117+
run: make build binaries
118+
working-directory: src/github.com/containerd/continuity
119+
120+
- name: Linux Tests
121+
if: startsWith(matrix.os, 'ubuntu')
122+
run: |
123+
make test
124+
sudo GOPATH=$GOPATH make root-test
125+
working-directory: src/github.com/containerd/continuity
126+
127+
- name: Non-Linux Tests
128+
if: ${{ !startsWith(matrix.os, 'ubuntu') }}
129+
shell: bash
130+
run: make test-compile
131+
working-directory: src/github.com/containerd/continuity

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ before_script:
2929
script:
3030
- export GOOS=${TRAVIS_GOOS}
3131
- make build binaries
32-
- if [ "$GOOS" = "linux" ]; then make vet test; fi
32+
- if [ "$GOOS" = "linux" ]; then make test; fi
3333
- if [ "$GOOS" = "linux" ]; then sudo PATH=$PATH GOPATH=$GOPATH make root-test; fi
3434
- if [ "$GOOS" != "linux" ]; then make test-compile; fi
3535

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ TEST_REQUIRES_ROOT_PACKAGES=$(filter \
3333
done | sort -u) \
3434
)
3535

36-
.PHONY: clean all fmt vet lint build test binaries
36+
.PHONY: clean all lint build test binaries
3737
.DEFAULT: default
38-
# skip lint at the moment
39-
all: AUTHORS clean fmt vet fmt build test binaries
38+
39+
all: AUTHORS clean lint build test binaries
4040

4141
AUTHORS: .mailmap .git/HEAD
4242
git log --format='%aN <%aE>' | sort -fu > $@

0 commit comments

Comments
 (0)