chore: pipeline warnings #1234
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
permissions: | |
contents: read | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} | |
jobs: | |
commitlint: | |
name: Check Commit Message | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 30 | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install Required Dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y git curl | |
curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash - | |
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs | |
npm install conventional-changelog-conventionalcommits | |
npm install --save-dev @commitlint/config-conventional | |
npm install commitlint@latest | |
- name: Print Versions | |
run: | | |
git --version | |
node --version | |
npm --version | |
npx commitlint --version | |
- name: Validate Current (Last) Commit Message | |
if: github.event_name == 'push' | |
run: npx commitlint --last --verbose | |
- name: Validate PR Commit Messages | |
if: github.event_name == 'pull_request' | |
run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose | |
go-modules: | |
name: Test and Build Go Modules | |
runs-on: ubuntu-22.04 | |
timeout-minutes: 60 | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- name: Setup Cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/go/pkg/mod | |
~/.cache/go-build | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.work.sum') }} | |
restore-keys: ${{ runner.os }}-go- | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.22 | |
cache: false | |
cache-dependency-path: go.work.sum | |
- name: Determine Workspace Modules | |
run: | | |
echo $(go list -f '{{.Dir}}' -m) | |
echo "GO_LINT_DIRS=$(go list -f '{{.Dir}}/...' -m | grep -v '/external/geth' | tr '\n' ' ')" >> ${GITHUB_ENV} | |
- name: Run Gofmt | |
run: go list -f '{{.Dir}}' -m | xargs gofmt -d -e -l | |
- name: Run Tidy & Workspace Sync | |
run: | | |
go list -f '{{.Dir}}' -m | xargs -L1 go mod tidy -C | |
go work sync | |
git checkout ${{ github.event.pull_request.head.ref }} | |
git diff --name-only --exit-code . || (echo "Golang modules/workspace not in sync with go.mod/go.sum/go.work/go.work.sum files" && exit 1) | |
git reset --hard HEAD | |
- name: Run Lint | |
uses: golangci/golangci-lint-action@v4 | |
with: | |
version: v1.57.2 | |
args: --timeout 15m --verbose ${{ env.GO_LINT_DIRS }} | |
skip-cache: true # TODO(mrekucci): remove when the following issue is solved https://github.com/golangci/golangci-lint-action/issues/135#issuecomment-2039548548 | |
- name: Run Build | |
run: go list -f '{{.Dir}}/...' -m | xargs go build | |
# TODO(mrekucci): Re-enable /external/geth module when tests are passing. | |
- name: Run Test | |
run: go list -f '{{.Dir}}/...' -m | grep -v '/external/geth' | xargs go test -short -race | |
- name: Setup Protobuf | |
uses: bufbuild/[email protected] | |
- name: Protobuf Version | |
run: buf --version | |
- name: Check Protobuf Parity | |
run: | | |
make bufgen | |
git checkout ${{ github.event.pull_request.head.ref }} | |
git diff --name-only --exit-code . || (echo "Generated files not in parity with the source files." && exit 1) | |
git reset --hard HEAD | |
working-directory: p2p |