Skip to content

Bump to signed common #1638

Bump to signed common

Bump to signed common #1638

Workflow file for this run

name: golangci_lint
on:
push:
jobs:
golangci-lint-version:
name: Get golangci-lint version to from nix
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Install Nix
uses: cachix/install-nix-action@29bd9290ef037a3ecbdafe83cbd2185e9dd0fa0a # v20
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Parse version
id: parse
run: |
long=$(nix develop -c golangci-lint version | grep "golangci-lint has version")
stringArray=($long)
version=$(echo "${stringArray[3]}")
echo "version found: ${version}"
echo "version=${version}" >>$GITHUB_OUTPUT
outputs:
version: ${{ steps.parse.outputs.version }}
golang_lint_relayer:
name: Golang Lint Relayer
runs-on: ubuntu-latest
needs: [golangci-lint-version]
steps:
- name: Checkout sources
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Install Nix
uses: cachix/install-nix-action@29bd9290ef037a3ecbdafe83cbd2185e9dd0fa0a # v20
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Lint relayer
run: nix develop -c make lint-go-relayer
- name: Print Report
if: failure()
run: cat ./relayer/golangci-lint-relayer-report.xml
- name: Store Golangci lint relayer report artifact
if: always()
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
with:
name: golangci-lint-relayer-report
path: ./relayer/golangci-lint-relayer-report.xml
golang_lint_ops:
name: Golang Lint Ops
runs-on: ubuntu-latest
needs: [golangci-lint-version]
steps:
- name: Checkout sources
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Install Nix
uses: cachix/install-nix-action@29bd9290ef037a3ecbdafe83cbd2185e9dd0fa0a # v20
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Lint ops
run: nix develop -c make lint-go-ops
- name: Print Report
if: failure()
run: cat ./ops/golangci-lint-ops-report.xml
- name: Store Golangci lint ops report artifact
if: always()
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
with:
name: golangci-lint-ops-report
path: ./ops/golangci-lint-ops-report.xml
golang_lint_integration_tests:
name: Golang Lint Integration Tests
runs-on: ubuntu-latest
needs: [golangci-lint-version]
steps:
- name: Checkout sources
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Install Nix
uses: cachix/install-nix-action@29bd9290ef037a3ecbdafe83cbd2185e9dd0fa0a # v20
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Lint integration-tests
run: nix develop -c make lint-go-test
- name: Print Report
if: failure()
run: cat ./integration-tests/golangci-lint-integration-tests-report.xml
- name: Store Golangci lint integration tests report artifact
if: always()
uses: actions/upload-artifact@3cea5372237819ed00197afe530f5a7ea3e805c8 # v3.1.0
with:
name: golangci-lint-integration-tests-report
path: ./integration-tests/golangci-lint-integration-tests-report.xml
# Note: I could not figure out why the golangci-lint-action would not work even though it is technically running the same as above, error message is this:
# Running [/home/runner/golangci-lint-1.50.1-linux-amd64/golangci-lint run --out-format=github-actions --path-prefix=integration-tests --exclude=dot-imports] in [/home/runner/work/chainlink-starknet/chainlink-starknet/integration-tests] ...
# level=warning msg="[runner] Can't run linter goanalysis_metalinter: inspect: failed to load package client: could not load export data: no export data for \"github.com/smartcontractkit/chainlink-testing-framework/client\""
# level=error msg="Running error: 1 error occurred:\n\t* can't run linter goanalysis_metalinter: inspect: failed to load package client: could not load export data: no export data for \"github.com/smartcontractkit/chainlink-testing-framework/client\"\n\n"
# - name: golangci-lint
# uses: golangci/golangci-lint-action@v3
# env:
# CGO_ENABLED: 1
# with:
# version: v${{ needs.golangci-lint-version.outputs.version }}
# working-directory: integration-tests
# args: --exclude=dot-imports