From 08adcbded9af695229ab4c75b6a87656c4c2fab9 Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Wed, 29 Jul 2026 23:19:21 +0000 Subject: [PATCH] initial workdlows --- code-quality.yaml | 10 +++++++++ static-go.yaml | 31 +++++++++++++++++++++++++++ style-web.yaml | 54 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 95 insertions(+) create mode 100644 code-quality.yaml create mode 100644 static-go.yaml create mode 100644 style-web.yaml diff --git a/code-quality.yaml b/code-quality.yaml new file mode 100644 index 0000000..e50e957 --- /dev/null +++ b/code-quality.yaml @@ -0,0 +1,10 @@ +name: Main Code Quality Orchestrator +on: + workflow_call: + +jobs: + static-go: + uses: tronnet/workflows/static-go.yaml@main + + style-web: + uses: tronnet/workflows/style-web.yaml@main \ No newline at end of file diff --git a/static-go.yaml b/static-go.yaml new file mode 100644 index 0000000..f9ef6cb --- /dev/null +++ b/static-go.yaml @@ -0,0 +1,31 @@ +name: Static Analysis -- Golang +run-name: 'Static Analysis -- Golang -- ${{ gitea.repository }} ${{ gitea.ref_name }} ${{ gitea.sha }}' +on: + workflow_call: + +jobs: + lint-check: + runs-on: ubuntu-latest + steps: + - name: Check Out Repository + uses: actions/checkout@v4 + with: + submodules: 'true' + + - name: Initialize Runner + uses: actions/setup-go@v7 + with: + go-version-file: 'go.mod' + + - name: Initialize Go + run: make build-web && 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/style-web.yaml b/style-web.yaml new file mode 100644 index 0000000..0996d9d --- /dev/null +++ b/style-web.yaml @@ -0,0 +1,54 @@ +name: Code Style -- Web Components +run-name: 'Code Style -- Web Components -- ${{ gitea.repository }} ${{ gitea.ref_name }} ${{ gitea.sha }}' +on: + workflow_call: + +jobs: + lint-check: + runs-on: ubuntu-latest + steps: + - name: Check Out Repository + uses: actions/checkout@v4 + + - name: Initialize Runner + uses: actions/setup-node@v4 + + - name: Install Linters + run: | + npm install --no-save \ + @eslint/eslintrc \ + @eslint/js \ + eslint \ + globals \ + html-validate \ + stylelint \ + stylelint-config-standard + + - name: Verify Linters + run: | + npx html-validate --version + npx stylelint --version + npx eslint --version + + - name: Run HTMLValidate + id: html_lint + run: npx html-validate --config dev_config/.htmlvalidate.json 'web/html/**/*' + + - name: Run Stylelint + id: style_lint + if: always() + run: npx stylelint --config dev_config/.stylelintrc.json --formatter verbose --fix 'web/css/**/*.css' + + - name: Run ESLint + id: js_lint + if: always() + env: + DEBUG: eslint:cli-engine + run: npx eslint --config dev_config/eslint.config.mjs --fix web/scripts/ + + - name: Verify Linters + 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