Skip to content

e2e: Update Optimism stack commits #4107

e2e: Update Optimism stack commits

e2e: Update Optimism stack commits #4107

Workflow file for this run

# Copyright (c) 2024 Hemi Labs, Inc.
# Use of this source code is governed by the MIT License,
# which can be found in the LICENSE file.
# GitHub Actions workflow to lint, build and test.
name: "Go"
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
workflow_call:
concurrency:
group: "go-${{ github.workflow }}-${{ github.event.number || github.ref }}"
cancel-in-progress: "${{ github.event_name == 'pull_request' }}"
env:
# renovate: datasource=github-releases depName=golangci/golangci-lint versioning=semver
GOLANGCI_LINT_VERSION: "v2.11.4"
# renovate: datasource=github-releases depName=joshuasing/golicenser versioning=semver
GOLICENSER_VERSION: "v0.3.1"
permissions:
contents: read
jobs:
lint:
name: "Lint"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout repository"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
- name: "Setup Go"
id: "go"
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: "go.mod"
- name: "golangci-lint"
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
with:
version: "${{ env.GOLANGCI_LINT_VERSION }}"
- name: "golangci-lint fmt"
run: golangci-lint fmt --diff ./...
- name: "Cache golicenser"
uses: actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4
with:
path: "/home/runner/go/bin/golicenser"
key: "${{ runner.os }}-golicenser-${{ env.GOLICENSER_VERSION }}-go${{ steps.go.outputs.go-version }}"
- name: "golicenser"
env:
LICENSE_HEADER: |
Copyright (c) {{.year}} {{.author}}
Use of this source code is governed by the MIT License,
which can be found in the LICENSE file.
run: |
if ! (command -v 'golicenser' >/dev/null); then
go install github.com/joshuasing/golicenser/cmd/golicenser@$GOLICENSER_VERSION
fi
echo "$LICENSE_HEADER" > license_header.txt
golicenser -author="Hemi Labs, Inc." -year-mode=git-range ./...
build:
name: "Build"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout repository"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: "Setup Go"
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: "go.mod"
- name: "Download and verify dependencies"
id: deps
run: make GOCACHE="$(go env GOCACHE)" go-deps
- name: "make build"
run: make GOCACHE="$(go env GOCACHE)" build
test:
name: "Test"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout repository"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: "Setup Go"
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: "go.mod"
- name: "Download and verify dependencies"
id: deps
run: make GOCACHE="$(go env GOCACHE)" go-deps
- name: "test synctest"
run: make synctest-test
- name: "make test (with E2E tests)"
env:
HEMI_DOCKER_TESTS: "1"
run: make GOCACHE="$(go env GOCACHE)" test
- name: "Upload coverage reports to Codecov"
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0
with:
files: ./coverage.out
token: "${{ secrets.CODECOV_TOKEN }}"
test-race:
name: "Test (race)"
runs-on: "ubuntu-latest"
steps:
- name: "Checkout repository"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: "Setup Go"
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: "go.mod"
- name: "Download and verify dependencies"
id: deps
run: make GOCACHE="$(go env GOCACHE)" go-deps
- name: "make race"
run: make GOCACHE="$(go env GOCACHE)" race