test: add unit test action on Ubuntu
This commit is contained in:
parent
5b2dda0477
commit
407501e5d1
54
.github/workflows/ubuntu.yaml
vendored
Normal file
54
.github/workflows/ubuntu.yaml
vendored
Normal file
@ -0,0 +1,54 @@
|
||||
name: Linux Unit tests
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
name: Build
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- name: Set up Go 1.x
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: ^1.13
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Install packages
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install cifs-utils procps conntrack -y
|
||||
GO111MODULE=off go get github.com/rexray/gocsi/csc
|
||||
|
||||
- name: Build Test
|
||||
run: |
|
||||
export PATH=$PATH:$HOME/.local/bin
|
||||
make verify
|
||||
go test -covermode=count -coverprofile=profile.cov ./pkg/...
|
||||
export DOCKER_CLI_EXPERIMENTAL=enabled && make container
|
||||
|
||||
- name: Integration Testing
|
||||
run: |
|
||||
export PATH=$PATH:$HOME/.local/bin
|
||||
make
|
||||
make integration-test
|
||||
|
||||
- name: Sanity test
|
||||
run: |
|
||||
export PATH=$PATH:$HOME/.local/bin
|
||||
make
|
||||
make sanity-test
|
||||
|
||||
- name: Send coverage
|
||||
env:
|
||||
COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
GO111MODULE=off go get github.com/mattn/goveralls
|
||||
$(go env GOPATH)/bin/goveralls -coverprofile=profile.cov -service=github
|
||||
Loading…
x
Reference in New Issue
Block a user