Initial commit
diff --git a/.github/workflows/go_test.yml b/.github/workflows/go_test.yml
new file mode 100644
index 0000000..4e94690
--- /dev/null
+++ b/.github/workflows/go_test.yml
@@ -0,0 +1,39 @@
+name: go_tests
+on:
+ workflow_call:
+ push:
+ branches-ignore:
+ - "queue-main-**"
+ pull_request:
+jobs:
+ test:
+ runs-on: "linux-x64-ubuntu-latest-64-core"
+ steps:
+ - uses: actions/checkout@master
+
+ - uses: actions/setup-go@v5
+ with:
+ go-version-file: "go.mod"
+ cache: true
+
+ - name: Cache Go 1.24.2
+ uses: actions/cache@v4
+ with:
+ path: |
+ ~/.cache/go-build
+ key: ${{ runner.os }}-go1.24.2-${{ hashFiles('**/go.sum') }}
+ restore-keys: |
+ ${{ runner.os }}-go1.24.2-
+
+ - name: Install tools
+ run: |
+ go install golang.org/x/tools/gopls@latest
+
+ - name: Go generate
+ run: |
+ go generate ./...
+
+ - name: Run tests
+ run: |
+ go test -v ./...
+ go test -v -race ./...
diff --git a/.github/workflows/queue-main.yml b/.github/workflows/queue-main.yml
new file mode 100644
index 0000000..ae0f0b1
--- /dev/null
+++ b/.github/workflows/queue-main.yml
@@ -0,0 +1,37 @@
+# Simplified Commit Queue
+#
+# (Force) push to "queue-main-$USER" a potential change, and
+# this job will push it main if it passes pre-commit and tests,
+# which will run in parallel. The push may fail if the commit
+# cannot be pushed cleanly because it needs to be rebased, which
+# will happen especially if another developer pushes a change at
+# roughly the same time.
+
+name: Main Branch Commit Queue
+on:
+ push:
+ branches:
+ - "queue-main-**"
+
+permissions: read-all
+
+jobs:
+ test:
+ uses: ./.github/workflows/go_test.yml
+ permissions: read-all
+
+ push-to-main:
+ runs-on: ubuntu-latest
+ needs: [test]
+ permissions:
+ contents: write
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+
+ - name: Push to main
+ run: |
+ git config --global user.name "GitHub Actions Bot"
+ git config --global user.email "actions@github.com"
+ git push origin HEAD:main