commit 6369cd702de6a6d82d4a6f2a70fdbe8bcc7f5ff5 Author: Arthur Lu Date: Wed Jul 29 23:19:21 2026 +0000 initial workflows diff --git a/.gitea/scoped_workflows/static-go.yaml b/.gitea/scoped_workflows/static-go.yaml new file mode 100644 index 0000000..672cfda --- /dev/null +++ b/.gitea/scoped_workflows/static-go.yaml @@ -0,0 +1,48 @@ +name: Static Analysis -- Golang +run-name: 'Static Analysis -- Golang -- ${{ gitea.repository }} ${{ gitea.ref_name }} ${{ gitea.sha }}' +on: + push: + branches: + - '*' + paths: + - '**/*.go' + +jobs: + static-go: + 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: Check and Run `make workflow-init` + run: | + if [ ! -f Makefile ]; then + echo "No Makefile found in root directory. Skipping." + exit 0 + fi + if make -n workflow-init >/dev/null 2>&1; then + echo "Target 'workflow-init' found. Running make workflow-init..." + make workflow-init + else + echo "Target 'workflow-init' does not exist in Makefile. Skipping." + fi + + - 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/scoped_workflows/style-web.yaml b/.gitea/scoped_workflows/style-web.yaml new file mode 100644 index 0000000..facd0b5 --- /dev/null +++ b/.gitea/scoped_workflows/style-web.yaml @@ -0,0 +1,86 @@ +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: + style-web: + 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: Check and Run `make workflow-init` + run: | + if [ ! -f Makefile ]; then + echo "No Makefile found in root directory. Skipping." + exit 0 + fi + if make -n workflow-init >/dev/null 2>&1; then + echo "Target 'workflow-init' found. Running make workflow-init..." + make workflow-init + else + echo "Target 'workflow-init' does not exist in Makefile. Skipping." + fi + + - 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