From a0bba9e52acb9c5cc7252bbe54d4959b145f4778 Mon Sep 17 00:00:00 2001 From: mrekucci <4932785+mrekucci@users.noreply.github.com> Date: Fri, 29 Mar 2024 15:40:13 -0500 Subject: [PATCH] chore: introduce .github --- .github/dependabot.yml | 11 ++++++++ .github/workflows/go-ci.yml | 52 +++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/go-ci.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..5570e3132 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "gomod" + directory: "/" + schedule: + interval: "weekly" diff --git a/.github/workflows/go-ci.yml b/.github/workflows/go-ci.yml new file mode 100644 index 000000000..1504d0509 --- /dev/null +++ b/.github/workflows/go-ci.yml @@ -0,0 +1,52 @@ +name: mev-commit-ci + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build-and-test: + name: Build and Test + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Setup Golang + uses: actions/setup-go@v5 + with: + go-version: 1.22.1 + dependencies-path: go.work.sum + id: go + + - name: List Golang Workspace Modules + run: go list -f '{{.Dir}}' -m + + - name: Tidy + run: go list -f '{{.Dir}}' -m | xargs -L1 go mod tidy -C + + - name: Sync + run: go work sync + + - name: Lint + uses: golangci/golangci-lint-action@v4 + with: + version: v1.57.2 + args: --timeout 5m $(go list -f '{{.Dir}}/...' -m) + + - name: Vet + run: go list -f '{{.Dir}}/...' -m | xargs go vet + + - name: Build + run: go list -f '{{.Dir}}/...' -m | xargs go build + + - name: Test + run: go list -f '{{.Dir}}/...' -m | xargs go test -v +