-
Notifications
You must be signed in to change notification settings - Fork 2
70 lines (60 loc) · 1.79 KB
/
go.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
59
60
61
62
63
64
65
66
67
68
69
70
name: Go
on:
push:
branches: [ master ]
pull_request: {}
permissions:
contents: read
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- macos-latest
- ubuntu-latest
- windows-latest
steps:
- name: Set up Go
uses: actions/[email protected]
with:
go-version: 1.16
id: go
- name: Set up Python
if: runner.os != 'Windows'
uses: actions/[email protected]
with:
python-version: "3.9"
id: python
- name: Check out code into the Go module directory
uses: actions/[email protected]
- name: Build
env:
GO111MODULE: on
run: go build -v .
- name: Test
env:
GO111MODULE: on
run: go test -v ./...
- name: Test Host bash
# FIXME: make this work on Windows as well
if: runner.os != 'Windows'
env:
GO111MODULE: on
run: make test-stdlib test-bash
- name: GitHub Actions Env Test Setup
# FIXME: make this work on Windows as well
if: runner.os != 'Windows'
run: |
cd test/scenarios/github-actions/
../../../direnv allow
../../../direnv export gha >> "$GITHUB_ENV"
- name: GitHub Actions Env Test Verification
# FIXME: make this work on Windows as well
if: runner.os != 'Windows'
run: |
[[ -z ${TEST_EXPORT_DIRENV_GITHUB_ACTIONS:-} ]] && echo "TEST_EXPORT_DIRENV_GITHUB_ACTIONS is unset or empty" >&2 && exit 1
tee TEST_EXPORT_DIRENV_GITHUB_ACTIONS.got <<<"$TEST_EXPORT_DIRENV_GITHUB_ACTIONS"
echo "${GITHUB_SHA}"$'\n'"${GITHUB_RUN_ID}"$'\n'"${GITHUB_RUN_NUMBER}" | tee TEST_EXPORT_DIRENV_GITHUB_ACTIONS.want
diff -u TEST_EXPORT_DIRENV_GITHUB_ACTIONS.want TEST_EXPORT_DIRENV_GITHUB_ACTIONS.got