Skip to content

Commit

Permalink
Run tests on pull requests and merges
Browse files Browse the repository at this point in the history
This adds a github workflow that tests the code when a pull request
is submitted or merged.

Signed-off-by: Carolyn Van Slyck <me@carolynvanslyck.com>
  • Loading branch information
carolynvs committed Mar 29, 2022
1 parent e3c7424 commit df00e44
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Test

on: [push]

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Set up Go cache
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18
- name: Configure Agent
run: go run mage.go ConfigureAgent
- name: Build
run: mage Build
- name: Test
run: mage Test
15 changes: 15 additions & 0 deletions mage.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//go:build ignore
// +build ignore

package main

import (
"os"

"github.com/magefile/mage/mage"
)

// This file allows someone to run mage commands without mage installed
// by running `go run mage.go TARGET`.
// See https://magefile.org/zeroinstall/
func main() { os.Exit(mage.Main()) }

0 comments on commit df00e44

Please sign in to comment.