...
1on: [push, pull_request]
2name: Test
3jobs:
4 test_v3_module:
5 strategy:
6 matrix:
7 go-version: [1.16.x, 1.17.x]
8 os: [ubuntu-20.04, ubuntu-18.04, windows-2019, windows-2016, macOS-10.15, macos-11]
9 runs-on: ${{ matrix.os }}
10 steps:
11 - name: Install Go
12 uses: actions/setup-go@v2
13 with:
14 go-version: ${{ matrix.go-version }}
15 - name: Checkout code
16 uses: actions/checkout@v2
17 - name: Test
18 run: |
19 cd ./v3/
20 go test ./...
21
22 test_v3_gopath:
23 env:
24 GOPATH: ${{ github.workspace }}
25 GO111MODULE: off
26 strategy:
27 matrix:
28 go-version: [1.16.x, 1.17.x]
29 os: [ubuntu-20.04, ubuntu-18.04, windows-2019, windows-2016, macOS-10.15, macos-11]
30 runs-on: ${{ matrix.os }}
31 steps:
32 - name: Install Go
33 uses: actions/setup-go@v2
34 with:
35 go-version: ${{ matrix.go-version }}
36 - name: Checkout code
37 uses: actions/checkout@v2
38 with:
39 path: ${{ github.workspace }}/src/github.com/shirou/gopsutil
40 - name: Get dependencies
41 run: |
42 go get -t github.com/shirou/gopsutil/v3/...
43 - name: Test
44 run: |
45 go test github.com/shirou/gopsutil/v3/...
46
47 test_v2_gopath:
48 env:
49 GOPATH: ${{ github.workspace }}
50 GO111MODULE: off
51 strategy:
52 matrix:
53 go-version: [1.16.x, 1.17.x]
54 os: [ubuntu-20.04, ubuntu-18.04, windows-2019, windows-2016, macOS-10.15, macos-11]
55 runs-on: ${{ matrix.os }}
56 steps:
57 - name: Install Go
58 uses: actions/setup-go@v2
59 with:
60 go-version: ${{ matrix.go-version }}
61 - name: Checkout code
62 uses: actions/checkout@v2
63 with:
64 path: ${{ github.workspace }}/src/github.com/shirou/gopsutil
65 - name: Get dependencies
66 if: runner.os == 'Windows'
67 run: |
68 go get -d -u github.com/golang/dep
69 cd $Env:GOPATH/src/github.com/golang/dep
70 git checkout v0.5.4
71 go install -ldflags="-X main.version=v0.5.4" ./cmd/dep
72 echo "$Env:GOPATH/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
73 cd $Env:GOPATH/src/github.com/shirou/gopsutil
74 dep ensure
75 # exclude v3 from being run with ./...
76 try { rm -ErrorAction:Stop -Recurse -Force $Env:GOPATH/src/github.com/shirou/gopsutil/v3 } catch [System.Management.Automation.ItemNotFoundException] {}
77 - name: Get dependencies
78 if: runner.os != 'Windows'
79 run: |
80 if ! command -v dep &>/dev/null; then
81 mkdir -p $GOPATH/bin
82 curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
83 echo "PATH=$GOPATH/bin:$PATH" >> $GITHUB_PATH
84 fi
85 cd $GOPATH/src/github.com/shirou/gopsutil
86 dep ensure
87 # exclude v3 from being run with ./...
88 rm -rf $GOPATH/src/github.com/shirou/gopsutil/v3
89 - name: Test
90 run: |
91 go test github.com/shirou/gopsutil/...
View as plain text