Merge pull request #134 from sue445/migrator/20240411222921_migrate_t… #348
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |