Skip to content

Commit

Permalink
Migrate to GitHub Actions (#27)
Browse files Browse the repository at this point in the history
* Change from Travis to GitHub Actions.
* Change from gox to goreleaser.
* Add .gitignore.
  • Loading branch information
smola authored Jan 15, 2021
1 parent 79e002d commit 6d0d922
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 39 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: continuous integration
on: [push, pull_request]
jobs:
test:
strategy:
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
go: [ '1.13.x', '1.14.x', '1.15.x' ]
runs-on: ${{ matrix.platform }}
name: Test (go ${{ matrix.go }}, ${{ matrix.platform }})
env:
- CGO_ENABLED=0
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- name: Run tests
run: go test -coverprofile=coverage.txt -covermode=atomic ./...
shell: bash
- name: Upload coverage
uses: codecov/codecov-action@v1
with:
files: coverage.txt
flags: ${{ matrix.go }},${{ matrix.platform }}
publish:
if: startsWith(github.ref, 'refs/tags/')
needs: test
runs-on: ubuntu-latest
name: Publish
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.15.x'
- name: Run goreleaser
uses: goreleaser/goreleaser-action@v2
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.gocompat.json
dist
32 changes: 32 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
before:
hooks:
- go mod download
builds:
- id: default-build
main: ./cmd/gocompat/main.go
binary: gocompat
env:
- CGO_ENABLED=0
goos:
- linux
- windows
- darwin
goarch:
- '386'
- amd64
- arm64
mod_timestamp: '{{ .CommitTimestamp }}'
archives:
- id: default-archive
builds:
- default-build
format: tar.gz
format_overrides:
- goos: windows
format: zip
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
39 changes: 0 additions & 39 deletions .travis.yml

This file was deleted.

0 comments on commit 6d0d922

Please sign in to comment.