From 4e14bbd8a08d087c04d5f031e41a4bda977b64a5 Mon Sep 17 00:00:00 2001 From: Haris Thohir Date: Mon, 10 Jun 2024 20:39:51 +0700 Subject: [PATCH] run test on workflow --- .github/workflows/go.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/go.yml diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..edaf1bd --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,38 @@ +name: Go + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up Go + uses: actions/setup-go@v2 + with: + go-version: '^1.17' + + - name: Cache Go modules + uses: actions/cache@v2 + with: + path: | + ~/.cache/go-build + ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + + - name: Install dependencies + run: go mod tidy + + - name: Run tests + run: go test ./...