Skip to content

Commit 5107377

Browse files
authored
Switch from Travis CI to GitHub Actions (#38)
1 parent 82670d1 commit 5107377

File tree

4 files changed

+85
-15
lines changed

4 files changed

+85
-15
lines changed

.github/workflows/ci.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
11+
test:
12+
name: Test
13+
runs-on: ubuntu-latest
14+
steps:
15+
16+
- name: Set up Go 1.x
17+
uses: actions/setup-go@v2
18+
with:
19+
go-version: ^1.13
20+
id: go
21+
22+
- name: Check out code into the Go module directory
23+
uses: actions/checkout@v2
24+
25+
- name: Cache go module cache
26+
id: cache-go-mod
27+
uses: actions/cache@v2
28+
with:
29+
path: ~/go/pkg/mod
30+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
31+
restore-keys: |
32+
${{ runner.os }}-go-
33+
34+
- name: Get dependencies
35+
run: go mod download
36+
37+
- name: Build
38+
run: make build
39+
40+
- name: Lint
41+
uses: golangci/golangci-lint-action@v1
42+
with:
43+
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
44+
version: v1.27
45+
46+
- name: Test
47+
run: make test
48+
49+
- uses: shogo82148/actions-goveralls@v1
50+
with:
51+
path-to-profile: cover.out
52+
53+
deploy:
54+
name: Deploy
55+
needs: test
56+
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
57+
runs-on: ubuntu-latest
58+
steps:
59+
60+
- name: Check out code into the Go module directory
61+
uses: actions/checkout@v2
62+
63+
- name: Push helm-operator image to Quay
64+
uses: docker/build-push-action@v1
65+
with:
66+
username: ${{ secrets.QUAY_USERNAME }}
67+
password: ${{ secrets.QUAY_PASSWORD }}
68+
registry: quay.io
69+
repository: joelanford/helm-operator
70+
tags: master
71+
72+
- name: Push example nginx-operator image to Quay
73+
uses: docker/build-push-action@v1
74+
with:
75+
path: example/
76+
username: ${{ secrets.QUAY_USERNAME }}
77+
password: ${{ secrets.QUAY_PASSWORD }}
78+
registry: quay.io
79+
repository: joelanford/nginx-operator
80+
tags: latest

.travis.yml

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

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ COPY pkg/ pkg/
1515
COPY version/ version/
1616

1717
# Build
18-
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o manager main.go
18+
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -a -o helm-operator main.go
1919

2020
# Use distroless as minimal base image to package the manager binary
2121
# Refer to https://github.com/GoogleContainerTools/distroless for more details
2222
FROM gcr.io/distroless/static:nonroot
2323
WORKDIR /
24-
COPY --from=builder /workspace/manager .
24+
COPY --from=builder /workspace/helm-operator .
2525
USER nonroot:nonroot
2626

27-
ENTRYPOINT ["/manager"]
27+
ENTRYPOINT ["/helm-operator"]

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ test: fmt vet testbin
1717
go test -race -covermode atomic -coverprofile cover.out ./...
1818

1919
# Build manager binary
20-
manager: fmt vet
21-
go build -o bin/manager main.go
20+
build: fmt vet
21+
go build -o bin/helm-operator main.go
2222

2323
# Run go fmt against code
2424
fmt:

0 commit comments

Comments
 (0)