-
Notifications
You must be signed in to change notification settings - Fork 54
59 lines (44 loc) · 1.48 KB
/
validate.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
name: Validate
on: [push, pull_request]
jobs:
lint:
name: Lint code base
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Cache dev dependencies
uses: actions/cache@v2
with:
path: ./.tmp
key: ${{ runner.os }}-dependencies-${{ hashFiles('./Makefile') }}
- name: Lint with shellcheck
run: make lint
test:
name: Test
runs-on: ubuntu-latest
defaults:
run:
shell: 'script -q -e -c "bash -i -eo pipefail {0}"'
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Mock cURL and wget
run: |
echo "REAL_CURL=$(which curl)" >> $GITHUB_ENV
echo "REAL_WGET=$(which wget)" >> $GITHUB_ENV
echo "$(pwd)/mocks/" >> $GITHUB_PATH
- name: Install g using g-install with default options
run: curl -sSL https://git.io/g-install | sh -s -- -y bash
- name: Verify environment variables
run: test ! -z "${GOROOT?}" && test ! -z "${GOPATH?}"
- name: Verify g installation
run: g --version
- name: Verify go installation
run: go version
- name: Make sure it is the go binary installed by g
run: test "$(which go)" = "$GOPATH/bin/go"
- name: Make sure g can switch versions
run: g install 1.14.15 && go version | grep -1 "go1.14.15"
- name: Make sure g can self-upgrade
run: SHELL="$(which bash)" g self-upgrade