mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-05 08:18:17 +00:00
* chore: add prettier configuration Signed-off-by: Xe Iaso <me@xeiaso.net> * format: run prettier tree-wide Signed-off-by: Xe Iaso <me@xeiaso.net> * chore(prettier): ignore intentionally ungrammatical files Signed-off-by: Xe Iaso <me@xeiaso.net> * ci: add PR title lint rule Signed-off-by: Xe Iaso <me@xeiaso.net> * ci: add DCO check Signed-off-by: Xe Iaso <me@xeiaso.net> * chore: add commitlint and husky Signed-off-by: Xe Iaso <me@xeiaso.net> * chore: add CONTRIBUTING guidelines Signed-off-by: Xe Iaso <me@xeiaso.net> * chore: set SKIP_INTEGRATION in precommit tests Signed-off-by: Xe Iaso <me@xeiaso.net> * chore: update spelling Signed-off-by: Xe Iaso <me@xeiaso.net> * ci(dco): remove reopened trigger Signed-off-by: Xe Iaso <me@xeiaso.net> * chore: remove dead file Signed-off-by: Xe Iaso <me@xeiaso.net> * chore(prettier): don't format nginx includes Signed-off-by: Xe Iaso <me@xeiaso.net> --------- Signed-off-by: Xe Iaso <me@xeiaso.net>
77 lines
2.3 KiB
YAML
77 lines
2.3 KiB
YAML
name: Go Mod Tidy Check
|
|
|
|
on:
|
|
push:
|
|
branches: ["main"]
|
|
pull_request:
|
|
branches: ["main"]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
go_mod_tidy_check:
|
|
runs-on: ubuntu-24.04
|
|
steps:
|
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
|
|
with:
|
|
go-version: "1.25.4"
|
|
|
|
- name: Check go.mod and go.sum in main directory
|
|
run: |
|
|
# Store original file state
|
|
cp go.mod go.mod.orig
|
|
cp go.sum go.sum.orig
|
|
|
|
# Run go mod tidy
|
|
go mod tidy
|
|
|
|
# Check if files changed
|
|
if ! diff -q go.mod.orig go.mod > /dev/null 2>&1; then
|
|
echo "ERROR: go.mod in main directory has changed after running 'go mod tidy'"
|
|
echo "Please run 'go mod tidy' locally and commit the changes"
|
|
diff go.mod.orig go.mod
|
|
exit 1
|
|
fi
|
|
|
|
if ! diff -q go.sum.orig go.sum > /dev/null 2>&1; then
|
|
echo "ERROR: go.sum in main directory has changed after running 'go mod tidy'"
|
|
echo "Please run 'go mod tidy' locally and commit the changes"
|
|
diff go.sum.orig go.sum
|
|
exit 1
|
|
fi
|
|
|
|
echo "SUCCESS: go.mod and go.sum in main directory are tidy"
|
|
|
|
- name: Check go.mod and go.sum in test directory
|
|
run: |
|
|
cd test
|
|
|
|
# Store original file state
|
|
cp go.mod go.mod.orig
|
|
cp go.sum go.sum.orig
|
|
|
|
# Run go mod tidy
|
|
go mod tidy
|
|
|
|
# Check if files changed
|
|
if ! diff -q go.mod.orig go.mod > /dev/null 2>&1; then
|
|
echo "ERROR: go.mod in test directory has changed after running 'go mod tidy'"
|
|
echo "Please run 'go mod tidy' locally and commit the changes"
|
|
diff go.mod.orig go.mod
|
|
exit 1
|
|
fi
|
|
|
|
if ! diff -q go.sum.orig go.sum > /dev/null 2>&1; then
|
|
echo "ERROR: go.sum in test directory has changed after running 'go mod tidy'"
|
|
echo "Please run 'go mod tidy' locally and commit the changes"
|
|
diff go.sum.orig go.sum
|
|
exit 1
|
|
fi
|
|
|
|
echo "SUCCESS: go.mod and go.sum in test directory are tidy"
|