From 9ec3fa39e057a8db533aaa9ab4ee58420b3d2336 Mon Sep 17 00:00:00 2001 From: Arthur Lu Date: Wed, 29 Jul 2026 23:19:21 +0000 Subject: [PATCH] initial workflows --- .gitea/scoped_workflows/static-go.yaml | 35 ++++++++++++ .gitea/scoped_workflows/style-web.yaml | 73 ++++++++++++++++++++++++++ 2 files changed, 108 insertions(+) create mode 100644 .gitea/scoped_workflows/static-go.yaml create mode 100644 .gitea/scoped_workflows/style-web.yaml diff --git a/.gitea/scoped_workflows/static-go.yaml b/.gitea/scoped_workflows/static-go.yaml new file mode 100644 index 0000000..ccbb1e1 --- /dev/null +++ b/.gitea/scoped_workflows/static-go.yaml @@ -0,0 +1,35 @@ +name: Static Analysis -- Golang +run-name: 'Static Analysis -- Golang -- ${{ gitea.repository }} ${{ gitea.ref_name }} ${{ gitea.sha }}' +on: + push: + branches: + - '*' + paths: + - '**/*.go' + +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/.gitea/scoped_workflows/style-web.yaml b/.gitea/scoped_workflows/style-web.yaml new file mode 100644 index 0000000..c524d96 --- /dev/null +++ b/.gitea/scoped_workflows/style-web.yaml @@ -0,0 +1,73 @@ +name: Code Style -- Web Components +run-name: 'Code Style -- Web Components -- ${{ gitea.repository }} ${{ gitea.ref_name }} ${{ gitea.sha }}' +on: + push: + branches: + - '*' + paths: + - '**/*.html' + - '**/*.css' + - '**/*.js' + +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-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: style-html + if: always() + run: | + CONFIG_FILE="dev_config/.htmlvalidate.json" + if [ -f "$CONFIG_FILE" ]; then + npx html-validate --config $CONFIG_FILE '**/*.html' + fi + + - name: Run Stylelint + id: style-css + if: always() + run: | + CONFIG_FILE="dev_config/.stylelintrc.json" + if [ -f "$CONFIG_FILE" ]; then + npx stylelint --config $CONFIG_FILE --formatter verbose '**/*.css' + fi + + - name: Run ESLint + id: style-js + if: always() + run: | + CONFIG_FILE="dev_config/eslint.config.mjs" + if [ -f "$CONFIG_FILE" ]; then + npx eslint --config $CONFIG_FILE '**/*.js' + fi + + - name: Verify Linters + if: > + steps.style-html.outcome != 'success' || + steps.style-css.outcome != 'success' || + steps.style-js.outcome != 'success' + run: exit 1 \ No newline at end of file