Skip to content

Commit ecf3c70

Browse files
committed
Test with GitHub actions
1 parent cc91047 commit ecf3c70

File tree

3 files changed

+51
-69
lines changed

3 files changed

+51
-69
lines changed

.github/workflows/test.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
on:
2+
push:
3+
branches: [ master ]
4+
pull_request:
5+
workflow_dispatch:
6+
name: Test
7+
permissions:
8+
contents: read
9+
jobs:
10+
test:
11+
strategy:
12+
matrix:
13+
go-version: [1.17.x, 1.18.x]
14+
os: [ubuntu-latest, macos-latest, windows-latest]
15+
runs-on: ${{ matrix.os }}
16+
steps:
17+
- name: Install Go
18+
uses: actions/setup-go@v3
19+
with:
20+
go-version: ${{ matrix.go-version }}
21+
- name: Install staticcheck
22+
run: go install honnef.co/go/tools/cmd/staticcheck@latest
23+
shell: bash
24+
- name: Install golint
25+
run: go install golang.org/x/lint/golint@latest
26+
shell: bash
27+
- name: Update PATH
28+
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
29+
shell: bash
30+
- name: Checkout code
31+
uses: actions/checkout@v1
32+
- name: Fmt
33+
if: matrix.os != 'windows-latest'
34+
run: "diff <(gofmt -d .) <(printf '')"
35+
shell: bash
36+
- name: Vet
37+
run: go vet ./...
38+
- name: Staticcheck
39+
run: staticcheck ./...
40+
- name: Lint
41+
run: golint ./...
42+
- name: Test
43+
run: go test -race ./libsass -coverprofile=coverage.txt -covermode=atomic
44+
- name: Upload coverage
45+
if: success() && matrix.os == 'ubuntu-latest'
46+
run: |
47+
curl -s https://codecov.io/bash | bash
48+
env:
49+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
50+
shell: bash

.travis.yml

Lines changed: 0 additions & 68 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
[![Build Status](https://travis-ci.org/bep/golibsass.svg?branch=master)](https://travis-ci.org/bep/golibsass)
2+
[![Tests on Linux, MacOS and Windows](https://github.com/bep/golibsass/workflows/Test/badge.svg)](https://github.com/bep/golibsass/actions?query=workflow:Test)
33
[![Go Report Card](https://goreportcard.com/badge/github.com/bep/golibsass)](https://goreportcard.com/report/github.com/bep/golibsass)
44
[![LibSass Version](https://img.shields.io/badge/LibSass-v3.6.5-blue)](https://github.com/sass/libsass)
55
[![codecov](https://codecov.io/gh/bep/golibsass/branch/master/graph/badge.svg)](https://codecov.io/gh/bep/golibsass)

0 commit comments

Comments
 (0)