From 4bc31707408aab04a771f4f2a058fdacc873608c Mon Sep 17 00:00:00 2001 From: geoknee Date: Tue, 30 Jan 2024 16:12:42 +0000 Subject: [PATCH] ci: add golang-modules-tidy job and run tests from module directories --- .circleci/config.yml | 45 ++++++++++++++++++++++++++++++-------------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index ca019b93f2..bc86192526 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,30 +8,46 @@ jobs: working_directory: ~/superchain-registry/ executor: name: go/default # is based on cimg/go - tag: '1.20' + tag: '1.21' steps: - checkout: path: ~/superchain-registry - run: golangci-lint run superchain validation + golang-modules-tidy: + working_directory: ~/superchain-registry + executor: + name: go/default # is based on cimg/go + tag: '1.21' + steps: + - checkout: + path: ~/superchain-registry + - run: + name: tidy superchain module + command: go mod tidy + working_directory: superchain + - run: + name: tidy validation module + command: go mod tidy + working_directory: validation + - run: + name: check git tree is clean + command: git diff --exit-code golang-test: - working_directory: ~/superchain-registry/ + working_directory: ~/superchain-registry executor: name: go/default # is based on cimg/go - tag: '1.20' + tag: '1.21' steps: - checkout: path: ~/superchain-registry - - go/mod-download - - go/test: - packages: ./superchain/... - covermode: atomic - failfast: true - race: true - - go/test: - packages: ./validation/... - covermode: atomic - failfast: true - race: true + - run: + name: run superchain module tests + command: go test ./... -v + working_directory: superchain + - run: + name: run validation module tests + command: go test ./... -v + working_directory: validation publish-bot: environment: NODE_AUTH_TOKEN: $NPM_TOKEN # Use NPM_TOKEN as the auth token @@ -90,6 +106,7 @@ workflows: main: jobs: - golang-lint + - golang-modules-tidy - golang-test - check-codegen - check-forge-fmt