Skip to content

Commit

Permalink
Merge pull request #432 from mackerelio/gha
Browse files Browse the repository at this point in the history
migrate CIs to GitHub Actions
  • Loading branch information
lufia authored Nov 30, 2020
2 parents e8d600c + d1576ec commit 9b3eb59
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 62 deletions.
54 changes: 49 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ on:
branches:
- master
pull_request:

env:
GO111MODULE: on
DEBIAN_FRONTEND: noninteractive
jobs:
test:
strategy:
Expand All @@ -20,10 +22,14 @@ jobs:
with:
go-version: ${{ matrix.go }}
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- run: |
make lint
make cover
make lint cover testconvention test
test-windows:
strategy:
matrix:
Expand All @@ -34,9 +40,47 @@ jobs:
with:
go-version: ${{ matrix.go }}
- uses: actions/checkout@v2
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- run: |
go build -o check-log/check-log.exe ./check-log
go build -o check-procs/check-procs.exe ./check-procs
go build -o check-windows-eventlog/check-windows-evenglog.exe ./check-windows-eventlog
go vet -all ./check-log/... ./check-procs/... ./check-ntservice/... ./check-windows-eventlog/...
go test ./check-log/... ./check-procs/... ./check-ntservice/... ./check-windows-eventlog/...
release:
needs: [test, test-windows]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- run: |
sudo apt-get update
sudo apt-get install -y rpm devscripts debhelper fakeroot crossbuild-essential-arm64
mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- uses: actions/setup-go@v2
with:
go-version: 1.14.x
- uses: actions/checkout@v2
- run: |
go get github.com/x-motemen/gobump/cmd/gobump
go get github.com/mackerelio/golib/cmd/mackerel-github-release
make clean build rpm deb
mackerel-github-release && mackerel-github-release -staging
env:
GITHUB_TOKEN: ${{ secrets.MACKERELBOT_GITHUB_TOKEN }}
- uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,message,commit,action,eventName,ref,workflow,job,took
username: go-check-plugins-release
env:
SLACK_WEBHOOK_URL: ${{ secrets.MACKEREL_SLACK_WEBHOOK_URL }}
38 changes: 0 additions & 38 deletions .travis.yml

This file was deleted.

19 changes: 0 additions & 19 deletions appveyor.yml

This file was deleted.

0 comments on commit 9b3eb59

Please sign in to comment.