From d17cfe6e0e4ead15331a76b08220cbc1f2f5c960 Mon Sep 17 00:00:00 2001 From: Ricky White Date: Tue, 22 Aug 2023 10:23:14 -0400 Subject: [PATCH 1/2] Added GitHub Action for testing - Triggered when there is a push or pr to main. Can also be triggered manually. - Uses the go version as specified in the go.mod file. --- .github/workflows/test.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..e6c9b8b --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,22 @@ +name: Test + +on: + push: + branches: [main] + pull_request: + branches: [main] + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version-file: "go.mod" + + - name: Test + run: go test -v ./... From 9cb2e5e6074309f50f7db3a68836902261b5de0e Mon Sep 17 00:00:00 2001 From: Ricky White Date: Tue, 22 Aug 2023 10:49:34 -0400 Subject: [PATCH 2/2] Add test build to workflow --- .github/workflows/test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e6c9b8b..0ae0392 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -18,5 +18,8 @@ jobs: with: go-version-file: "go.mod" + - name: Test Build + run: go build -v -o ssh-sign ./cmd/ssh-sign/main.go + - name: Test run: go test -v ./...