-
Notifications
You must be signed in to change notification settings - Fork 94
103 lines (94 loc) · 2.76 KB
/
ci.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
schedule:
- cron: '0 2 * * 1-5'
env:
GOPROXY: "https://proxy.golang.org"
TAGS: "-tags=ci"
COVERAGE: "-coverpkg=github.com/go-python/gpython/..."
jobs:
build:
name: Build
strategy:
matrix:
go-version: [1.19.x, 1.18.x]
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Setup Git for Windows
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Cache-Go
uses: actions/cache@v1
with:
# In order:
# * Module download cache
# * Build cache (Linux)
# * Build cache (Mac)
# * Build cache (Windows)
path: |
~/go/pkg/mod
~/.cache/go-build
~/Library/Caches/go-build
'%LocalAppData%\go-build'
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
- name: Install Linux packages
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -qq pkg-config python3
- name: Build-Linux-32b
if: matrix.platform == 'ubuntu-latest'
run: |
GOARCH=386 go install -v $TAGS ./...
- name: Build-Linux-64b
if: matrix.platform == 'ubuntu-latest'
run: |
GOARCH=amd64 go install -v $TAGS ./...
- name: Build-Windows
if: matrix.platform == 'windows-latest'
run: |
go install -v $TAGS ./...
- name: Build-Darwin
if: matrix.platform == 'macos-latest'
run: |
go install -v $TAGS ./...
- name: Test Linux
if: matrix.platform == 'ubuntu-latest'
run: |
GOARCH=386 go test $TAGS ./...
GOARCH=amd64 go run ./ci/run-tests.go $TAGS -race $COVERAGE
## FIXME(sbinet): bring back python3.4 or upgrade gpython to python3.x
## python3 py3test.py
- name: Test Windows
if: matrix.platform == 'windows-latest'
run: |
go run ./ci/run-tests.go $TAGS -race
- name: Test Darwin
if: matrix.platform == 'macos-latest'
run: |
go run ./ci/run-tests.go $TAGS -race
- name: static-check
uses: dominikh/[email protected]
with:
install-go: false
cache-key: ${{ matrix.platform }}
version: "2022.1"
- name: Upload-Coverage
if: matrix.platform == 'ubuntu-latest'
uses: codecov/codecov-action@v1