-
Notifications
You must be signed in to change notification settings - Fork 1
46 lines (42 loc) · 1.46 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
on: [push, pull_request]
name: Test
env:
GO111MODULE: off
GOPATH: /home/runner/go
jobs:
Build:
strategy:
matrix:
go-version: [1.17.x]
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
- name: Fetch Repository
uses: actions/checkout@v2
- name: Create issue using REST API
run: |
echo curl --request POST \
--url https://api.github.com/repos/${{ github.repository }}/issues \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--header 'content-type: application/json' \
--data '{
"title": "Automated issue for commit: ${{ github.sha }}",
"body": "This issue was automatically created by the GitHub Action workflow **${{ github.workflow }}**. \n\n The commit hash was: _${{ github.sha }}_."
}'
- name: Run Test
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
go env | grep -E 'GO111MODULE|GOPATH'
mkdir -p $GOPATH/src/github.com/$GITHUB_ACTOR
mv $GITHUB_WORKSPACE $GOPATH/src/github.com/$GITHUB_ACTOR
ln -s $GOPATH/src/github.com/$GITHUB_REPOSITORY $GITHUB_WORKSPACE
#cat ${HOME}/.gitconfig
#go env -w GOPRIVATE=github.com/${GITHUB_REPOSITORY}
#go env | grep AntonioSun
go get -v ./...
go test -v -race