Skip to content

Commit 2fe883e

Browse files
committed
ci: add GitHub action
Signed-off-by: Sebastien Binet <[email protected]>
1 parent b35bc0f commit 2fe883e

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed

.github/workflows/ci.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [ master ]
6+
7+
jobs:
8+
9+
build:
10+
name: Build
11+
strategy:
12+
matrix:
13+
go-version: [1.16.x, 1.15.x]
14+
platform: [ubuntu-latest]
15+
16+
runs-on: ${{ matrix.platform }}
17+
env:
18+
GO111MODULE: on
19+
GOPATH: ${{ github.workspace }}
20+
GODEBUG: cgocheck=0
21+
defaults:
22+
run:
23+
working-directory: ${{ env.GOPATH }}/src/gonum.org/v1/gonum
24+
25+
steps:
26+
- name: Install Go
27+
uses: actions/setup-go@v2
28+
with:
29+
go-version: ${{ matrix.go-version }}
30+
31+
- name: Cache-Go
32+
uses: actions/cache@v1
33+
with:
34+
path: |
35+
~/go/pkg/mod # Module download cache
36+
~/.cache/go-build # Build cache (Linux)
37+
~/Library/Caches/go-build # Build cache (Mac)
38+
'%LocalAppData%\go-build' # Build cache (Windows)
39+
40+
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
41+
restore-keys: |
42+
${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
43+
44+
- name: Checkout code
45+
uses: actions/checkout@v2
46+
with:
47+
path: ${{ env.GOPATH }}/src/gonum.org/v1/hdf5
48+
49+
- name: Install Linux packages
50+
if: matrix.platform == 'ubuntu-latest'
51+
run: |
52+
sudo apt-get update
53+
sudo apt-get install -qq pkg-config libhdf5-serial-dev
54+
55+
- name: Build
56+
run: |
57+
go install ./...
58+
59+
- name: Test
60+
run: |
61+
go test ./...

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# hdf5
22

3+
[![Build status](https://github.com/gonum/hdf5/workflows/CI/badge.svg)](https://github.com/gonum/hdf5/actions)
34
[![Build Status](https://secure.travis-ci.org/gonum/hdf5.png)](http://travis-ci.org/gonum/hdf5)
45
[![GoDoc](https://godoc.org/gonum.org/v1/hdf5?status.svg)](https://godoc.org/gonum.org/v1/hdf5)
56

0 commit comments

Comments
 (0)