From 7b979f4974923b0b626fd7a35f2fb015e8549d4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Hells=C3=A9n?= Date: Mon, 5 Feb 2024 17:28:23 +0100 Subject: [PATCH] Add a GitHub workflow for Golang --- .github/go.yml | 36 ++++++++++++++++++++++++++++++++++++ .vscode/settings.json | 1 + 2 files changed, 37 insertions(+) create mode 100644 .github/go.yml diff --git a/.github/go.yml b/.github/go.yml new file mode 100644 index 0000000..bb4286e --- /dev/null +++ b/.github/go.yml @@ -0,0 +1,36 @@ +name: Go + +on: + push: + pull_request: + workflow_dispatch: + schedule: + - cron: "0 0 * * *" + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + check-latest: true + go-version: stable + + - name: Install dependencies + run: go get . + + - name: Test + run: go test -v + + - name: Lint + run: go vet . + + - name: Fmt + run: go fmt . + + - name: Build + run: go build -v -ldflags="-s -w" diff --git a/.vscode/settings.json b/.vscode/settings.json index 84e3089..40ddac8 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -30,6 +30,7 @@ "homerouter", "hotspot", "huaweimobilewifi", + "ldflags", "leftright", "levelname", "listparser",