sshpiper/.github/workflows/go.yml
2023-01-05 05:03:06 -08:00

55 lines
1.3 KiB
YAML

name: Go Unit Test
on:
push:
branches: [ master ]
pull_request:
types: [assigned, opened, synchronize, reopened]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v3
with:
go-version: ^1.19
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: 'recursive'
# https://github.com/mvdan/github-actions-golang
- uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- uses: dotnet/nbgv@master
with:
setAllVars: true
- name: Test lib ssh
run: go test -v -cover ./...
working-directory: crypto/ssh
- name: Test sshpiper
run: go test -v -race -cover -tags full ./...
- name: create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: github.ref == 'refs/heads/master'
run: |
gh release create -d --generate-notes v$NBGV_SimpleVersion
gh release list | grep Draft | tail -n +3 | cut -f 1 | xargs -r -L 1 gh release delete --yes