From d98136bac76e132a2c4e16f144145a0dc48a432e Mon Sep 17 00:00:00 2001 From: macie Date: Mon, 11 Mar 2024 21:28:04 +0100 Subject: [PATCH] ci: Add quality check Runs tests and linters after each commit. --- .github/workflows/check.yaml | 47 ++++++++++++++++++++++++++++++++++++ README.ja.md | 1 + README.md | 1 + README.zh.md | 1 + 4 files changed, 50 insertions(+) create mode 100644 .github/workflows/check.yaml diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml new file mode 100644 index 0000000..ac9e66d --- /dev/null +++ b/.github/workflows/check.yaml @@ -0,0 +1,47 @@ +name: Quality check +on: + push: + branches: + - "*" + pull_request: + +permissions: + contents: read + +jobs: + static-analysis: + name: Static analysis + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: 'stable' + + - run: go vet ./... + + - name: staticcheck + uses: dominikh/staticcheck-action@v1.3.0 + with: + install-go: false + + tests: + name: Tests + runs-on: ubuntu-latest + timeout-minutes: 10 + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: 'stable' + + - run: go test ./... diff --git a/README.ja.md b/README.ja.md index 2247118..3d6af93 100644 --- a/README.ja.md +++ b/README.ja.md @@ -1,5 +1,6 @@ # ![OpenGFW](docs/logo.png) +[![Quality check status](https://github.com/apernet/OpenGFW/actions/workflows/check.yml/badge.svg)](https://github.com/apernet/OpenGFW/actions/workflows/check.yml) [![License][1]][2] [1]: https://img.shields.io/badge/License-MPL_2.0-brightgreen.svg diff --git a/README.md b/README.md index 36e5817..1466e42 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # ![OpenGFW](docs/logo.png) +[![Quality check status](https://github.com/apernet/OpenGFW/actions/workflows/check.yml/badge.svg)](https://github.com/apernet/OpenGFW/actions/workflows/check.yml) [![License][1]][2] [1]: https://img.shields.io/badge/License-MPL_2.0-brightgreen.svg diff --git a/README.zh.md b/README.zh.md index 4639e71..74e4a8e 100644 --- a/README.zh.md +++ b/README.zh.md @@ -1,5 +1,6 @@ # ![OpenGFW](docs/logo.png) +[![Quality check status](https://github.com/apernet/OpenGFW/actions/workflows/check.yml/badge.svg)](https://github.com/apernet/OpenGFW/actions/workflows/check.yml) [![License][1]][2] [1]: https://img.shields.io/badge/License-MPL_2.0-brightgreen.svg