Skip to content

Commit

Permalink
Add an input base path to the setup actions
Browse files Browse the repository at this point in the history
  • Loading branch information
tateexon committed Jun 29, 2024
1 parent 2d7f01f commit fca8a00
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 51 deletions.
10 changes: 7 additions & 3 deletions .github/actions/setup-nodejs/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ inputs:
prod:
default: "false"
description: Set to 'true' to do a prod only install
base-path:
description: Path to the base of the repo
required: false
default: .
description: Setup pnpm for contracts
runs:
using: composite
Expand All @@ -15,16 +19,16 @@ runs:
with:
node-version: "20"
cache: "pnpm"
cache-dependency-path: "contracts/pnpm-lock.yaml"
cache-dependency-path: "${{ inputs.base-path }}/contracts/pnpm-lock.yaml"

- if: ${{ inputs.prod == 'false' }}
name: Install dependencies
shell: bash
run: pnpm i
working-directory: contracts
working-directory: ${{ inputs.base-path }}/contracts

- if: ${{ inputs.prod == 'true' }}
name: Install prod dependencies
shell: bash
run: pnpm i --prod
working-directory: contracts
working-directory: ${{ inputs.base-path }}/contracts
9 changes: 7 additions & 2 deletions .github/actions/setup-postgres/action.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
name: Setup Postgresql
description: Setup postgres docker container via docker-compose, allowing usage of a custom command, see https://github.com/orgs/community/discussions/26688
inputs:
base-path:
description: Path to the base of the repo
required: false
default: .
runs:
using: composite
steps:
- name: Start postgres service
run: docker compose up -d
shell: bash
working-directory: ./.github/actions/setup-postgres
working-directory: ${{ inputs.base-path }}/.github/actions/setup-postgres
- name: Wait for postgres service to be healthy
run: ./wait-for-healthy-postgres.sh
shell: bash
working-directory: ./.github/actions/setup-postgres
working-directory: ${{ inputs.base-path }}/.github/actions/setup-postgres
8 changes: 7 additions & 1 deletion .github/actions/setup-solana/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: Setup Solana CLI
description: Setup solana CLI
inputs:
base-path:
description: Path to the base of the repo
required: false
default: .
runs:
using: composite
steps:
Expand All @@ -9,11 +14,12 @@ runs:
with:
path: |
~/.local/share/solana/install/active_release/bin
key: ${{ runner.os }}-solana-cli-${{ hashFiles('./tools/ci/install_solana') }}
key: ${{ runner.os }}-solana-cli-${{ hashFiles('${{ inputs.base-path }}tools/ci/install_solana') }}

- if: ${{ steps.cache.outputs.cache-hit != 'true' }}
name: Install solana cli
shell: bash
working-directory: ${{ inputs.base-path }}
run: ./tools/ci/install_solana

- name: Export solana path to env
Expand Down
8 changes: 7 additions & 1 deletion .github/actions/setup-wasmd/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: Setup Cosmos wasmd
description: Setup Cosmos wasmd, used for integration tests
inputs:
base-path:
description: Path to the base of the repo
required: false
default: .
runs:
using: composite
steps:
Expand All @@ -10,11 +15,12 @@ runs:
path: ~/wasmd-build
# this caching works without cloning the repo because the install_wasmd contains
# the commit hash.
key: ${{ runner.os }}-wasmd-cli-${{ hashFiles('./tools/ci/install_wasmd') }}
key: ${{ runner.os }}-wasmd-cli-${{ hashFiles('${{ inputs.base-path }}/tools/ci/install_wasmd') }}

- if: ${{ steps.cache.outputs.cache-hit != 'true' }}
name: Install wasmd
shell: bash
working-directory: ${{ inputs.base-path }}
run: ./tools/ci/install_wasmd

- name: Export wasmd path to env
Expand Down
48 changes: 4 additions & 44 deletions .github/workflows/ci-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,30 +114,10 @@ jobs:
- name: Setup Go
if: ${{ needs.filter.outputs.changes == 'true' }}
uses: ./.github/actions/setup-go

- name: Setup Github Token
id: get-gh-token
uses: smartcontractkit/.github/actions/setup-github-token@ef78fa97bf3c77de6563db1175422703e9e6674f # [email protected]
with:
aws-role-arn: ${{ secrets.AWS_OIDC_GLOBAL_READ_ONLY_TOKEN_ISSUER_ROLE_ARN }}
aws-lambda-url: ${{ secrets.AWS_INFRA_RELENG_TOKEN_ISSUER_LAMBDA_URL }}
aws-region: ${{ secrets.AWS_REGION }}
set-git-config: "true"
- name: Replace the chainlink-integration deps
- name: Replace chainlink-evm deps
if: ${{ needs.filter.outputs.changes == 'true' && inputs.evm-ref != ''}}
shell: bash
env:
MODULE: github.com/smartcontractkit/chainlink-integrations/evm/relayer
COMMIT_HASH: ${{ inputs.evm-ref }}
run: |
# Update to the evm/relayer code we wish to test against
go env -w GOPRIVATE=github.com/smartcontractkit/chainlink-integrations
go get ${MODULE}@${COMMIT_HASH}
# push replace into core go.mod, remove this once the evm migration is complete
PSEUDO_VERSION=$(go list -m -mod=mod ${MODULE}@${COMMIT_HASH} | awk '{print $2}')
go mod edit -replace=github.com/smartcontractkit/chainlink/v2/core/chains/evm=${MODULE}@${PSEUDO_VERSION}
go mod tidy
run: go get github.com/smartcontractkit/chainlink-integrations/evm/relayer@${{ inputs.evm-ref }}
- name: Run short tests
if: ${{ needs.filter.outputs.changes == 'true' && matrix.type.cmd == 'go_core_tests' }}
run: go test -short ./...
Expand Down Expand Up @@ -292,30 +272,10 @@ jobs:
- name: Download Go vendor packages
if: ${{ needs.filter.outputs.changes == 'true' }}
run: go mod download

- name: Setup Github Token
id: get-gh-token
uses: smartcontractkit/.github/actions/setup-github-token@ef78fa97bf3c77de6563db1175422703e9e6674f # [email protected]
with:
aws-role-arn: ${{ secrets.AWS_OIDC_GLOBAL_READ_ONLY_TOKEN_ISSUER_ROLE_ARN }}
aws-lambda-url: ${{ secrets.AWS_INFRA_RELENG_TOKEN_ISSUER_LAMBDA_URL }}
aws-region: ${{ secrets.AWS_REGION }}
set-git-config: "true"
- name: Replace the chainlink-integration deps
- name: Replace chainlink-evm deps
if: ${{ needs.filter.outputs.changes == 'true' && inputs.evm-ref != ''}}
shell: bash
env:
MODULE: github.com/smartcontractkit/chainlink-integrations/evm/relayer
COMMIT_HASH: ${{ inputs.evm-ref }}
run: |
# Update to the evm/relayer code we wish to test against
go env -w GOPRIVATE=github.com/smartcontractkit/chainlink-integrations
go get ${MODULE}@${COMMIT_HASH}
# push replace into core go.mod, remove this once the evm migration is complete
PSEUDO_VERSION=$(go list -m -mod=mod ${MODULE}@${COMMIT_HASH} | awk '{print $2}')
go mod edit -replace=github.com/smartcontractkit/chainlink/v2/core/chains/evm=${MODULE}@${PSEUDO_VERSION}
go mod tidy
run: go get github.com/smartcontractkit/chainlink-integrations/evm/relayer@${{ inputs.evm-ref }}
- name: Build binary
if: ${{ needs.filter.outputs.changes == 'true' }}
run: go build -o chainlink.test .
Expand Down

0 comments on commit fca8a00

Please sign in to comment.