Skip to content

Commit

Permalink
Add GitHub Actions workflow for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
meatballhat committed Nov 8, 2022
1 parent 0ccca56 commit 4f91f40
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: main
on:
push:
branches: [main]
tags: [v*]
pull_request:
branches: [main]
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
go: [1.18.x, 1.19.x]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go }}
- uses: actions/checkout@v3
- run: go test -v ./...
1 change: 1 addition & 0 deletions testdata/empty.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# empty file
6 changes: 3 additions & 3 deletions yaml_file_loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ func ExampleApp_Run_yamlFileLoaderDuration() {
Name: "config",
Aliases: []string{"c"},
EnvVars: []string{"CONFIG_FILE"},
Value: "../testdata/empty.yml",
DefaultText: "../testdata/empty.yml",
Value: "testdata/empty.yml",
DefaultText: "testdata/empty.yml",
Usage: "config file",
},
altsrc.NewDurationFlag(
Expand Down Expand Up @@ -78,7 +78,7 @@ func ExampleApp_Run_yamlFileLoaderDuration() {
},
}

if err := c.Run([]string{"cmd", "serve", "--config", "../testdata/empty.yml"}); err != nil {
if err := c.Run([]string{"cmd", "serve", "--config", "testdata/empty.yml"}); err != nil {
log.Fatal(err)
}

Expand Down

0 comments on commit 4f91f40

Please sign in to comment.