From b798fd9c9293861c7fe8fd323dce7c427d70d17d Mon Sep 17 00:00:00 2001 From: Sebastien Binet Date: Mon, 10 Jan 2022 16:50:55 +0100 Subject: [PATCH 1/2] all: add GitHub Actions CI --- .github/workflows/ci.yml | 94 ++++++++++++++++++++++++++++++++++++++++ README.md | 2 +- 2 files changed, 95 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..d8ded89c --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 diff --git a/README.md b/README.md index b0144853..a5068a0f 100644 --- a/README.md +++ b/README.md @@ -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) From 71a2bf6eedeee35d4482ec9d76c8965575862f10 Mon Sep 17 00:00:00 2001 From: Sebastien Binet Date: Mon, 10 Jan 2022 16:54:49 +0100 Subject: [PATCH 2/2] all: bump to Go-1.16 --- go.mod | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 4cda1cf1..095bd34f 100644 --- a/go.mod +++ b/go.mod @@ -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 )