mirror of
https://github.com/sorenisanerd/gotty.git
synced 2024-11-09 23:34:26 +00:00
Run tests on pull requests
Pull requests will automatically trigger a build and test run. The produced binaries are stored as artifacts in the Github workflow.
This commit is contained in:
parent
7d431a7bd6
commit
316d5ff442
28
.github/workflows/main.yaml
vendored
28
.github/workflows/main.yaml
vendored
@ -1,24 +1,30 @@
|
|||||||
name: Go
|
name: "Unit and Build Tests"
|
||||||
|
|
||||||
on:
|
on:
|
||||||
- push
|
push:
|
||||||
|
pull_request:
|
||||||
|
branches: [ master ]
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
build-test:
|
||||||
|
runs-on: "ubuntu-latest"
|
||||||
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v2
|
uses: actions/setup-go@v3
|
||||||
with:
|
with:
|
||||||
go-version: 1.16
|
go-version: 1.19
|
||||||
|
|
||||||
- name: Test
|
- name: "Build & test"
|
||||||
run: make test
|
run: "make tools test cross_compile"
|
||||||
|
|
||||||
- name: Build
|
- name: Upload build artifacts
|
||||||
run: make tools cross_compile
|
uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: binaries
|
||||||
|
path: builds/pkg/*/gotty
|
37
.github/workflows/pre-release.yaml
vendored
37
.github/workflows/pre-release.yaml
vendored
@ -1,37 +0,0 @@
|
|||||||
---
|
|
||||||
name: "pre-release"
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- "master"
|
|
||||||
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
pre-release:
|
|
||||||
name: "Pre Release"
|
|
||||||
runs-on: "ubuntu-latest"
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Set up Go
|
|
||||||
uses: actions/setup-go@v2
|
|
||||||
with:
|
|
||||||
go-version: 1.16
|
|
||||||
|
|
||||||
|
|
||||||
- name: "Build & test"
|
|
||||||
run: "make tools release-artifacts"
|
|
||||||
|
|
||||||
- uses: "marvinpinto/action-automatic-releases@latest"
|
|
||||||
with:
|
|
||||||
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
|
||||||
automatic_release_tag: "latest"
|
|
||||||
prerelease: true
|
|
||||||
title: "Development Build"
|
|
||||||
files: |
|
|
||||||
LICENSE
|
|
||||||
builds/dist/*
|
|
4
Makefile
4
Makefile
@ -55,8 +55,8 @@ README-options:
|
|||||||
rm options.txt.tmp
|
rm options.txt.tmp
|
||||||
|
|
||||||
tools:
|
tools:
|
||||||
go get github.com/mitchellh/gox
|
go install github.com/mitchellh/gox@latest
|
||||||
go get github.com/tcnksm/ghr
|
go install github.com/tcnksm/ghr@latest
|
||||||
|
|
||||||
test:
|
test:
|
||||||
if [ `go fmt $(go list ./... | grep -v /vendor/) | wc -l` -gt 0 ]; then echo "go fmt error"; exit 1; fi
|
if [ `go fmt $(go list ./... | grep -v /vendor/) | wc -l` -gt 0 ]; then echo "go fmt error"; exit 1; fi
|
||||||
|
Loading…
Reference in New Issue
Block a user