From eea02c52f8817f4fac20f89fd1f6bd02ea25031d Mon Sep 17 00:00:00 2001 From: Liam Beckman Date: Thu, 2 Jan 2025 18:25:56 -0800 Subject: [PATCH] Add test.yaml workflow --- .github/workflows/{go.yml => go.yaml} | 3 ++- .github/workflows/test.yaml | 32 +++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) rename .github/workflows/{go.yml => go.yaml} (94%) create mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yaml similarity index 94% rename from .github/workflows/go.yml rename to .github/workflows/go.yaml index ab50062..7711183 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yaml @@ -6,7 +6,8 @@ name: Go on: push: pull_request: - branches: [ "main" ] + branches: + - "main" jobs: diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..f653b2a --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,32 @@ +name: Test + +on: + push: + pull_request: + branches: + - main + +jobs: + lint: + name: lint + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-go@v3 + with: + go-version: 'stable' + + - name: Test + run: | + make + + ./server & + + curl --header "Authorization: Bearer Alyssa P. Hacker" \ + --data @example-tasks/hello-world.json \ + http://localhost:8080 + + curl --header "Authorization: Bearer Foo" \ + --data @example-tasks/hello-world.json \ + http://localhost:8080