Skip to content

feat: Add form randomization #52

feat: Add form randomization

feat: Add form randomization #52

Workflow file for this run

on: [push, pull_request]
name: CI
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Install Go 1.23.2
uses: actions/setup-go@v5
with:
go-version: "1.23.2"
check-latest: true
- name: Install Bun
uses: oven-sh/setup-bun@v2
- name: Checkout repository
uses: actions/checkout@v4
- name: Install JavaScript Dependencies
run: bun i
# Test
- name: Test and calculate coverage
run: go test -race -v -covermode=atomic -coverprofile=coverage.out ./...
# - name: Convert coverage.out to coverage.lcov
# uses: jandelgado/[email protected]
# - name: Coveralls
# uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.github_token }}
# path-to-lcov: coverage.lcov
- name: Run go vet
continue-on-error: true
run: go vet ./...
# Make sure templ generate was executed before commit
- name: Generate templates
run: go run github.com/a-h/templ/cmd/[email protected] generate
- name: Check file changes after templ generate
run: |
git diff --exit-code
id: diff_files_after_templ_generate
continue-on-error: true
- name: Fail if changes are detected
if: steps.diff_files_after_templ_generate.outcome == 'failure'
run: |
echo "Detected uncommitted changes after running templ generate." \
"Please regenerate .templ templates and commit changes." && exit 1
# Make sure CSS was built before commit
- name: Build CSS
run: bun run build:css
- name: Check file changes after building CSS
run: |
git diff --exit-code
id: diff_files_after_css_build
continue-on-error: true
- name: Fail if changes are detected
if: steps.diff_files_after_css_build.outcome == 'failure'
run: |
echo "Detected uncommitted changes after running bun run build:css" \
"Please regenerate all CSS and commit changes." && exit 1
# Make sure Lit web components were built before commit
- name: Build Lit WebComponents
run: bun run build:components
- name: Check file changes after building web components
run: |
git diff --exit-code
id: diff_files_after_lit_build
continue-on-error: true
- name: Fail if changes are detected
if: steps.diff_files_after_lit_build.outcome == 'failure'
run: |
echo "Detected uncommitted changes after running bun run build:components" \
"Please regenerate all Lit components and commit changes." && exit 1
# Make sure TypeScript was built before commit
- name: Build TypeScript
run: bun run build:ts
- name: Check file changes after building TypeScript
run: |
git diff --exit-code
id: diff_files_after_ts_build
continue-on-error: true
- name: Fail if changes are detected
if: steps.diff_files_after_ts_build.outcome == 'failure'
run: |
echo "Detected uncommitted changes after running bun run build:js" \
"Please regenerate all TypeScript and commit changes." && exit 1
# Try compile
- name: Compile
run: go build -o /dev/null ./cmd/server