Skip to content

Commit abbb0b2

Browse files
committed
all: add GitHub Actions CI
1 parent 4c28217 commit abbb0b2

File tree

2 files changed

+95
-1
lines changed

2 files changed

+95
-1
lines changed

.github/workflows/ci.yml

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
schedule:
9+
- cron: '0 2 * * 1-5'
10+
11+
env:
12+
GOPROXY: "https://proxy.golang.org"
13+
TAGS: "-tags=ci"
14+
COVERAGE: "-coverpkg=github.com/go-python/gpython/..."
15+
16+
jobs:
17+
18+
build:
19+
name: Build
20+
strategy:
21+
matrix:
22+
go-version: [1.17.x, 1.16.x]
23+
platform: [ubuntu-latest]
24+
runs-on: ${{ matrix.platform }}
25+
steps:
26+
- name: Install Go
27+
uses: actions/setup-go@v2
28+
with:
29+
go-version: ${{ matrix.go-version }}
30+
31+
- name: Setup Git for Windows
32+
run: |
33+
git config --global core.autocrlf false
34+
git config --global core.eol lf
35+
36+
- name: Checkout code
37+
uses: actions/checkout@v2
38+
39+
- name: Cache-Go
40+
uses: actions/cache@v1
41+
with:
42+
# In order:
43+
# * Module download cache
44+
# * Build cache (Linux)
45+
# * Build cache (Mac)
46+
# * Build cache (Windows)
47+
path: |
48+
~/go/pkg/mod
49+
~/.cache/go-build
50+
~/Library/Caches/go-build
51+
'%LocalAppData%\go-build'
52+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
53+
restore-keys: |
54+
${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
55+
56+
- name: Install Linux packages
57+
if: matrix.platform == 'ubuntu-latest'
58+
run: |
59+
sudo apt-get update
60+
sudo apt-get install -qq pkg-config python3
61+
62+
- name: Build-Linux-32b
63+
if: matrix.platform == 'ubuntu-latest'
64+
run: |
65+
GOARCH=386 go install -v $TAGS ./...
66+
- name: Build-Linux-64b
67+
if: matrix.platform == 'ubuntu-latest'
68+
run: |
69+
GOARCH=amd64 go install -v $TAGS ./...
70+
- name: Build-Windows
71+
if: matrix.platform == 'windows-latest'
72+
run: |
73+
go install -v $TAGS ./...
74+
- name: Build-Darwin
75+
if: matrix.platform == 'macos-latest'
76+
run: |
77+
go install -v $TAGS ./...
78+
- name: Test Linux
79+
if: matrix.platform == 'ubuntu-latest'
80+
run: |
81+
GOARCH=386 go test $TAGS ./...
82+
GOARCH=amd64 go run ./ci/run-tests.go $TAGS -race $COVERAGE
83+
python3 py3test.py
84+
- name: Test Windows
85+
if: matrix.platform == 'windows-latest'
86+
run: |
87+
go run ./ci/run-tests.go $TAGS
88+
- name: Test Darwin
89+
if: matrix.platform == 'macos-latest'
90+
run: |
91+
go run ./ci/run-tests.go $TAGS
92+
- name: Upload-Coverage
93+
if: matrix.platform == 'ubuntu-latest'
94+
uses: codecov/codecov-action@v1

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# gpython
22

3-
[![Build Status](https://travis-ci.org/go-python/gpython.svg?branch=master)](https://travis-ci.org/go-python/gpython)
3+
[![Build Status](https://github.com/go-python/gpython/workflows/CI/badge.svg)](https://github.com/go-python/gpython/actions)
44
[![codecov](https://codecov.io/gh/go-python/gpython/branch/master/graph/badge.svg)](https://codecov.io/gh/go-python/gpython)
55
[![GoDoc](https://godoc.org/github.com/go-python/gpython?status.svg)](https://godoc.org/github.com/go-python/gpython)
66
[![License](https://img.shields.io/badge/License-BSD--3-blue.svg)](https://github.com/go-python/gpython/blob/master/LICENSE)

0 commit comments

Comments
 (0)