Skip to content

Commit

Permalink
Run tests on pull requests
Browse files Browse the repository at this point in the history
Pull requests will automatically trigger a build and test run. The
produced binaries are stored as artifacts in the Github workflow.
  • Loading branch information
sorenisanerd committed Sep 1, 2022
1 parent 7d431a7 commit 81943f4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 50 deletions.
28 changes: 17 additions & 11 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
name: Go
name: "Unit and Build Tests"

on:
- push
push:
pull_request:
branches: [ master ]


jobs:
build-test:
runs-on: "ubuntu-latest"

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v2
uses: actions/setup-go@v3
with:
go-version: 1.16
go-version: 1.19

- name: Test
run: make test
- name: "Build & test"
run: "make tools test cross_compile"

- name: Build
run: make tools cross_compile
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: binaries
path: builds/pkg/*/gotty
37 changes: 0 additions & 37 deletions .github/workflows/pre-release.yaml

This file was deleted.

4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ README-options:
rm options.txt.tmp

tools:
go get github.com/mitchellh/gox
go get github.com/tcnksm/ghr
go install github.com/mitchellh/gox@latest
go install github.com/tcnksm/ghr@latest

test:
if [ `go fmt $(go list ./... | grep -v /vendor/) | wc -l` -gt 0 ]; then echo "go fmt error"; exit 1; fi
Expand Down

0 comments on commit 81943f4

Please sign in to comment.