Skip to content

all: add GitHub Actions CI #147

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
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.17.x, 1.16.x]
platform: [ubuntu-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

- 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
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: Upload-Coverage
if: matrix.platform == 'ubuntu-latest'
uses: codecov/codecov-action@v1
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# gpython

[![Build Status](https://travis-ci.org/go-python/gpython.svg?branch=master)](https://travis-ci.org/go-python/gpython)
[![Build Status](https://github.com/go-python/gpython/workflows/CI/badge.svg)](https://github.com/go-python/gpython/actions)
[![codecov](https://codecov.io/gh/go-python/gpython/branch/master/graph/badge.svg)](https://codecov.io/gh/go-python/gpython)
[![GoDoc](https://godoc.org/github.com/go-python/gpython?status.svg)](https://godoc.org/github.com/go-python/gpython)
[![License](https://img.shields.io/badge/License-BSD--3-blue.svg)](https://github.com/go-python/gpython/blob/master/LICENSE)
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module github.com/go-python/gpython

go 1.12
go 1.16

require (
github.com/gopherjs/gopherwasm v1.0.0 // indirect
github.com/gopherjs/gopherwasm v1.0.0
github.com/peterh/liner v1.1.0
)