-
Notifications
You must be signed in to change notification settings - Fork 3
58 lines (52 loc) · 1.49 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: test
on:
push:
branches:
- master
pull_request:
types:
- opened
- synchronize
- reopened
schedule:
- cron: "0 10 * * 5" # JST 19:00 (Fri)
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: "go.mod"
id: go
- name: Run test
run: |
set -xe
go test
go test -race
env:
TEST_CHATWORK_API_TOKEN: ${{ secrets.TEST_CHATWORK_API_TOKEN }}
TEST_CHATWORK_ROOM_ID: ${{ secrets.TEST_CHATWORK_ROOM_ID }}
TEST_SLACK_API_TOKEN: ${{ secrets.TEST_SLACK_API_TOKEN }}
TEST_SLACK_CHANNEL: ${{ secrets.TEST_SLACK_CHANNEL }}
TEST_SLACK_USER_NAME: ${{ secrets.TEST_SLACK_USER_NAME }}
TEST_SLACK_WEBHOOK: ${{ secrets.TEST_SLACK_WEBHOOK }}
- name: Run lint
run: |
set -xe
export GOPATH=`go env GOPATH`
export PATH=$GOPATH/bin:$PATH
! gofmt -d . | grep '^'
go get -v -t -d ./...
go install golang.org/x/lint/golint@latest
golint -set_exit_status
- name: Slack Notification
uses: act10ns/slack@v2
if: always()
continue-on-error: true
with:
status: ${{ job.status }}
webhook-url: ${{ secrets.SLACK_WEBHOOK }}