Commit 9a78c1c5 authored by Matthew Slipper's avatar Matthew Slipper Committed by GitHub

ci: Conditional check fixes (#2866)

- Outputs the raw GitHub response in check-changed
- Updates the golangci-lint version to the one in `go-builder` that supports 1.18
parent 68fc3fed
......@@ -166,7 +166,7 @@ jobs:
- run:
name: Check if we should run
command: |
CHANGED=$(check-changed "(packages/<<parameters.package_name>>|packages/<<parameters.dependencies>>")
CHANGED=$(check-changed "(packages/<<parameters.package_name>>|packages/<<parameters.dependencies>>)")
if [[ "$CHANGED" = "FALSE" ]]; then
circleci step halt
fi
......@@ -263,6 +263,13 @@ jobs:
- image: ethereumoptimism/ci-builder:latest
steps:
- checkout
- run:
name: Check if we should run
command: |
CHANGED=$(check-changed "op-node")
if [[ "$CHANGED" = "FALSE" ]]; then
circleci step halt
fi
- run:
name: Fuzz
command: make fuzz
......@@ -477,49 +484,49 @@ workflows:
- js-lint-test:
name: contracts-governance-tests
package_name: contracts-governance
dependencies: "core-utils|sdk"
dependencies: "(core-utils|sdk)"
requires:
- yarn-monorepo
- js-lint-test:
name: contracts-periphery-tests
package_name: contracts-periphery
dependencies: "contracts|contracts-bedrock|core-utils|hardhat-deploy-config"
dependencies: "(contracts|contracts-bedrock|core-utils|hardhat-deploy-config)"
requires:
- yarn-monorepo
- js-lint-test:
name: dtl-tests
package_name: data-transport-layer
dependencies: "common-ts|contracts|core-utils"
dependencies: "(common-ts|contracts|core-utils)"
requires:
- yarn-monorepo
- js-lint-test:
name: drippie-mon-tests
package_name: drippie-mon
dependencies: "common-ts|contracts-periphery|core-utils|sdk"
dependencies: "(common-ts|contracts-periphery|core-utils|sdk)"
requires:
- yarn-monorepo
- js-lint-test:
name: fault-detector-tests
package_name: fault-detector
dependencies: "common-ts|contracts|core-utils|sdk"
dependencies: "(common-ts|contracts|core-utils|sdk)"
requires:
- yarn-monorepo
- js-lint-test:
name: message-relayer-tests
package_name: message-relayer
dependencies: "common-ts|core-utils|sdk"
dependencies: "(common-ts|core-utils|sdk)"
requires:
- yarn-monorepo
- js-lint-test:
name: replica-healthcheck-tests
package_name: replica-healthcheck
dependencies: "common-ts|core-utils"
dependencies: "(common-ts|core-utils)"
requires:
- yarn-monorepo
- js-lint-test:
name: sdk-tests
package_name: sdk
dependencies: "contracts|core-utils"
dependencies: "(contracts|core-utils)"
requires:
- yarn-monorepo
- depcheck:
......
......@@ -24,7 +24,7 @@ RUN apt-get update && \
npm i -g depcheck && \
pip install slither-analyzer && \
go install gotest.tools/gotestsum@latest && \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.45.2 && \
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.46.2 && \
curl -fLSs https://raw.githubusercontent.com/CircleCI-Public/circleci-cli/master/install.sh | bash && \
chmod +x /usr/local/bin/check-changed
......
......@@ -14,9 +14,14 @@ echoerr() { echo "$@" 1>&2; }
if [[ -n $CIRCLE_PULL_REQUEST ]]; then
PACKAGE=$1
# Craft the URL to the GitHub API. The access token is optional for the monorepo since it's an open-source repo.
GITHUB_API_URL=$(echo "https://api.github.com/repos/${CIRCLE_PULL_REQUEST}?access_token=$GITHUB_ACCESS_TOKEN" | sed "s/\/pull\//\/pulls\//")
GITHUB_API_URL="https://api.github.com/repos/ethereum-optimism/optimism/pulls/${CIRCLE_PULL_REQUEST/https:\/\/github.com\/ethereum-optimism\/optimism\/pull\//}"
echoerr "GitHub URL:"
echoerr "$GITHUB_API_URL"
# Grab the PR's base ref using the GitHub API.
REF=$(curl -s "$GITHUB_API_URL" | jq -r ".base.ref")
PR=$(curl -H "Authorization: token $GITHUB_ACCESS_TOKEN" -H "Accept: application/vnd.github.v3+json" --retry 3 --retry-delay 1 -s "$GITHUB_API_URL")
echoerr "PR data:"
echoerr "$PR"
REF=$(echo "$PR" | jq -r ".base.ref")
echoerr "Base Ref: $REF"
echoerr "Base Ref SHA: $(git show-branch --sha1-name "$REF")"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment