Skip to content

Commit

Permalink
test: no nested composite actions
Browse files Browse the repository at this point in the history
  • Loading branch information
erikburt committed Dec 7, 2024
1 parent bf69b91 commit a310140
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 63 deletions.
47 changes: 0 additions & 47 deletions .github/actions/setup-ci-core-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,62 +7,15 @@ inputs:
The directory to run go mod download in. If not provided, it will not run go mod download.
required: false
default: ""

evm-ref-override:
description: |
Overrides the evm/relayer dependency version
required: false

db-url:
description: |
The expected database URL
required: true

mod-cache-version:
description: |
The version of the module cache to use. Used for cache busting.
required: false

build-cache-version:
description: |
The version of the build cache to use. Used for scoping build caches.
required: false

restore-build-cache-only:
description: |
Whether to create a build cache
required: false
default: "false"

runs:
using: composite
steps:
- name: Setup NodeJS
uses: ./.github/actions/setup-nodejs
with:
prod: "true"

- name: Setup Go
uses: ./.github/actions/setup-go
with:
cache-version: ${{ inputs.mod-cache-version }}
build-cache-version: ${{ inputs.build-cache-version }}
restore-build-cache-only: ${{ inputs.restore-build-cache-only }}

- name: Replace chainlink-evm deps
if: ${{ inputs.evm-ref-override != ''}}
shell: bash
run: go get github.com/smartcontractkit/chainlink-integrations/evm/relayer@${{ inputs.evm-ref-override }}

- name: Setup Solana
uses: ./.github/actions/setup-solana

- name: Setup wasmd
uses: ./.github/actions/setup-wasmd

- name: Setup Postgres
uses: ./.github/actions/setup-postgres

- name: Touching core/web/assets/index.html
shell: bash
run: mkdir -p core/web/assets && touch core/web/assets/index.html
Expand Down
60 changes: 51 additions & 9 deletions .github/workflows/ci-core-partial.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,26 @@ jobs:
- name: Checkout the repo
uses: actions/[email protected]

- name: Setup NodeJS
uses: ./.github/actions/setup-nodejs
with:
prod: "true"

- name: Setup Go
uses: ./.github/actions/setup-go
with:
build-cache-version: ${{ matrix.type.test-suite }}
restore-build-cache-only: "false"

- name: Setup Solana
uses: ./.github/actions/setup-solana

- name: Setup wasmd
uses: ./.github/actions/setup-wasmd

- name: Setup Postgres
uses: ./.github/actions/setup-postgres

- name: Setup CI Core Environment
uses: ./.github/actions/setup-ci-core-tests
with:
Expand Down Expand Up @@ -169,16 +189,27 @@ jobs:
run-fuzz-tests:
name: Tests (fuzz)
runs-on: ubuntu22.04-32cores-128GB

Check failure on line 191 in .github/workflows/ci-core-partial.yml

View workflow job for this annotation

GitHub Actions / Validate Workflow Changes

1. This Ubuntu runner is 8-16 more expensive than a base Ubuntu runner. Consider using a smaller Ubuntu runner. (runner-ubuntu / error)
if: ${{ github.event_name == 'schedule' }}
env:
DB_URL: postgresql://postgres:postgres@localhost:5432/chainlink_test?sslmode=disable
steps:
- name: Checkout the repo
uses: actions/[email protected]

- name: Change Modtime of Files (cache optimization)
shell: bash
run: |
find . -type f,d -exec touch -r {} -d '1970-01-01T00:00:01' {} \; || true
- name: Setup Go
uses: ./.github/actions/setup-go
with:
build-cache-version: "fuzz"
restore-build-cache-only: "true"

- name: Setup Solana
uses: ./.github/actions/setup-solana

- name: Setup wasmd
uses: ./.github/actions/setup-wasmd

- name: Setup Postgres
uses: ./.github/actions/setup-postgres

- name: Setup CI Core Environment
uses: ./.github/actions/setup-ci-core-tests
Expand Down Expand Up @@ -206,21 +237,32 @@ jobs:
run-race-tests:
name: Tests (race)
runs-on: ubuntu22.04-32cores-128GB

Check failure on line 239 in .github/workflows/ci-core-partial.yml

View workflow job for this annotation

GitHub Actions / Validate Workflow Changes

1. This Ubuntu runner is 8-16 more expensive than a base Ubuntu runner. Consider using a smaller Ubuntu runner. (runner-ubuntu / error)
if: ${{ github.event_name == 'schedule' }}
env:
DB_URL: postgresql://postgres:postgres@localhost:5432/chainlink_test?sslmode=disable
steps:
- name: Checkout the repo
uses: actions/[email protected]

- name: Change Modtime of Files (cache optimization)
shell: bash
run: |
find . -type f,d -exec touch -r {} -d '1970-01-01T00:00:01' {} \; || true
- name: Setup Go
uses: ./.github/actions/setup-go
with:
build-cache-version: "race"
restore-build-cache-only: "true"

- name: Setup Solana
uses: ./.github/actions/setup-solana

- name: Setup wasmd
uses: ./.github/actions/setup-wasmd

- name: Setup Postgres
uses: ./.github/actions/setup-postgres

- name: Setup CI Core Environment
uses: ./.github/actions/setup-ci-core-tests
with:
build-cache-version: "race"
build-cache-version: "fuzz"
restore-build-cache-only: "true"
db-url: ${{ env.DB_URL }}

Expand Down
69 changes: 62 additions & 7 deletions .github/workflows/ci-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,19 +154,74 @@ jobs:
uses: actions/[email protected]

- name: Change Modtime of Files (cache optimization)
if: ${{ needs.filter.outputs.should-run-ci-core == 'true' }}
shell: bash
run: |
find . -type f,d -exec touch -r {} -d '1970-01-01T00:00:01' {} \; || true
- name: Setup CI Core Environment
- name: Setup NodeJS
if: ${{ needs.filter.outputs.should-run-ci-core == 'true' }}
uses: ./.github/actions/setup-ci-core-tests
uses: ./.github/actions/setup-nodejs
with:
db-url: ${{ env.DB_URL }}
evm-ref-override: ${{ github.event.inputs.evm-ref }}
build-cache-version: ${{ matrix.type.cmd }}
prod: "true"

- name: Setup Go
if: ${{ needs.filter.outputs.should-run-ci-core == 'true' }}
uses: ./.github/actions/setup-go
with:
# race/fuzz tests don't benefit repeated caching, so restore from develop's build cache
restore-build-cache-only: ${{ matrix.type.cmd == 'go_core_fuzz' }}
build-cache-version: ${{ matrix.type.cmd }}

- name: Replace chainlink-evm deps
if: ${{ needs.filter.outputs.should-run-ci-core == 'true' && inputs.evm-ref != ''}}
shell: bash
run: go get github.com/smartcontractkit/chainlink-integrations/evm/relayer@${{ inputs.evm-ref }}

- name: Setup Solana
if: ${{ needs.filter.outputs.should-run-ci-core == 'true' }}
uses: ./.github/actions/setup-solana

- name: Setup wasmd
if: ${{ needs.filter.outputs.should-run-ci-core == 'true' }}
uses: ./.github/actions/setup-wasmd

- name: Setup Postgres
if: ${{ needs.filter.outputs.should-run-ci-core == 'true' }}
uses: ./.github/actions/setup-postgres

- name: Touching core/web/assets/index.html
if: ${{ needs.filter.outputs.should-run-ci-core == 'true' }}
run: mkdir -p core/web/assets && touch core/web/assets/index.html

- name: Download Go vendor packages
if: ${{ needs.filter.outputs.should-run-ci-core == 'true' }}
run: go mod download

- name: Build binary
if: ${{ needs.filter.outputs.should-run-ci-core == 'true' }}
run: go build -o chainlink.test .

- name: Setup DB
if: ${{ needs.filter.outputs.should-run-ci-core == 'true' }}
run: ./chainlink.test local db preparetest
env:
CL_DATABASE_URL: ${{ env.DB_URL }}

- name: Install LOOP Plugins
if: ${{ needs.filter.outputs.should-run-ci-core == 'true' }}
run: |
pushd $(go list -m -f "{{.Dir}}" github.com/smartcontractkit/chainlink-feeds)
go install ./cmd/chainlink-feeds
popd
pushd $(go list -m -f "{{.Dir}}" github.com/smartcontractkit/chainlink-data-streams)
go install ./mercury/cmd/chainlink-mercury
popd
pushd $(go list -m -f "{{.Dir}}" github.com/smartcontractkit/chainlink-solana)
go install ./pkg/solana/cmd/chainlink-solana
popd
pushd $(go list -m -f "{{.Dir}}" github.com/smartcontractkit/chainlink-starknet/relayer)
go install ./pkg/chainlink/cmd/chainlink-starknet
popd
- name: Increase Timeouts for Fuzz/Race
# Increase timeouts for scheduled runs only
Expand Down

0 comments on commit a310140

Please sign in to comment.