From 7f983853b083d7ebf94c40eabf02b3e15967b85f Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Wed, 29 Jul 2026 17:49:52 +0000 Subject: [PATCH] add static analysis action --- .gitea/workflows/go_stastic.yaml | 31 +++++++++++++++++++++++++++++++ .gitea/workflows/lint.yaml | 22 +++++----------------- 2 files changed, 36 insertions(+), 17 deletions(-) create mode 100644 .gitea/workflows/go_stastic.yaml diff --git a/.gitea/workflows/go_stastic.yaml b/.gitea/workflows/go_stastic.yaml new file mode 100644 index 0000000..6c619c8 --- /dev/null +++ b/.gitea/workflows/go_stastic.yaml @@ -0,0 +1,31 @@ +name: ProxmoxAAS-Dashboard Go Static Analysis Check +run-name: Go static analysis check on ${{ gitea.repository }} ${{ gitea.ref_name }} ${{ gitea.sha }} +on: + push: + branches: + - "*" + +jobs: + lint-check: + runs-on: ubuntu-latest + steps: + - name: Check Out Repository + uses: actions/checkout@v4 + + - name: Initialize Runner + uses: actions/setup-go@v7 + with: + go-version-file: 'go.mod' + + - name: Initialize Go + run: go get . + + - name: Run Go Vet + id: static_govet + if: always() + run: go vet ./... + + - name: Verify Static Analysis + if: > + steps.static_govet.outcome != 'success' + run: exit 1 \ No newline at end of file diff --git a/.gitea/workflows/lint.yaml b/.gitea/workflows/lint.yaml index 5d1306d..fbd954d 100644 --- a/.gitea/workflows/lint.yaml +++ b/.gitea/workflows/lint.yaml @@ -50,20 +50,8 @@ jobs: - name: Verify Linters if: always() - run: | - FAILED=0 - if [ "${{ steps.html_lint.outcome }}" != "success" ]; then - echo "HTML Linter failed" - FAILED=1 - fi - if [ "${{ steps.style_lint.outcome }}" != "success" ]; then - echo "Style Linter failed" - FAILED=1 - fi - if [ "${{ steps.js_lint.outcome }}" != "success" ]; then - echo "JS Linter failed" - FAILED=1 - fi - if [ $FAILED -eq 1 ]; then - exit 1 - fi \ No newline at end of file + if: > + steps.html_lint.outcome != 'success' || + steps.style_lint.outcome != 'success' || + steps.js_lint.outcome != 'success' + run: exit 1 \ No newline at end of file