forked from rogchap/v8go
-
-
Notifications
You must be signed in to change notification settings - Fork 6
47 lines (43 loc) · 1.24 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: CI
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
jobs:
test:
name: Tests on ${{ matrix.go-version }} ${{ matrix.platform }}
strategy:
matrix:
go-version: [1.18.10, 1.19.5]
platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go-version }}
- name: Checkout
uses: actions/checkout@v2
- name: Go Test
env:
CGO_CXXFLAGS: "-Werror"
run: go test -v -coverprofile c.out ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
env:
OS: ${{ matrix.platform }}
GO: ${{ matrix.go-version }}
with:
files: ./c.out
env_vars: OS,GO
- name: Add GOPATH to GITHUB_ENV
run: echo "GOPATH=$(go env GOPATH)" >>"$GITHUB_ENV"
- name: Scan and upload FOSSA data (Linux/Mac)
if: env.FOSSA_API_KEY != '' && github.ref == 'refs/heads/master'
run: |
curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install.sh | sudo bash
fossa analyze
env:
FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}