Skip to content

Commit

Permalink
fix: no nested composite actions
Browse files Browse the repository at this point in the history
  • Loading branch information
erikburt committed Dec 9, 2024
1 parent 460a75a commit 36bf962
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 68 deletions.
46 changes: 4 additions & 42 deletions .github/actions/setup-ci-core-tests/action.yml
Original file line number Diff line number Diff line change
@@ -1,62 +1,24 @@
name: Setup CI Core Tests
description: Shared setup steps for ci-core
description: |
Shared setup steps for ci-core.
Note: Other actions should not be called from this action. There is
weird behavior when nesting reusable actions.
inputs:

go-mod-download-directory:
description: |
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

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:
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
83 changes: 57 additions & 26 deletions .github/workflows/ci-core-partial.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ on:
# merge_group:
pull_request:
schedule:
- cron: "0 0 * * *"
- cron: "0 1 * * *"

env:
# We explicitly have this env var not be "CL_DATABASE_URL" to avoid having it be used by core related tests
# when they should not be using it, while still allowing us to DRY up the setup
DB_URL: postgresql://postgres:postgres@localhost:5432/chainlink_test?sslmode=disable

jobs:
filter:
Expand Down Expand Up @@ -51,19 +55,33 @@ jobs:
build-flags: "-tags=integration"
- test-suite: "ccip-deployment"
module-directory: "./deployment"
env:
# We explicitly have this env var not be "CL_DATABASE_URL" to avoid having it be used by core related tests
# when they should not be using it, while still allowing us to DRY up the setup
DB_URL: postgresql://postgres:postgres@localhost:5432/chainlink_test?sslmode=disable
steps:
- 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:
build-cache-version: ${{ matrix.type.test-suite }}
restore-build-cache-only: "true"
db-url: ${{ env.DB_URL }}
go-mod-download-directory: ${{ matrix.type.test-suite == 'ccip-deployment' && matrix.type.module-directory || '' }}

Expand Down Expand Up @@ -108,15 +126,15 @@ jobs:

scan:
name: SonarQube Scan
needs: [ run-unit-tests, filter ]
needs: [run-unit-tests, filter]
if: ${{ needs.filter.outputs.should-collect-coverage == 'true' }}
runs-on: ubuntu-latest
steps:
- name: Checkout the repo
uses: actions/[email protected]
with:
# fetches all history for all tags and branches to provide more metadata for sonar reports
fetch-depth: 0
fetch-depth: 0

- name: Download all workflow run artifacts
uses: actions/[email protected]
Expand Down Expand Up @@ -164,27 +182,33 @@ jobs:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
SONAR_SCANNER_OPTS: "-Xms6g -Xmx8g"


run-fuzz-tests:
name: Tests (fuzz)
runs-on: ubuntu22.04-32cores-128GB

Check failure on line 188 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)
env:
DB_URL: postgresql://postgres:postgres@localhost:5432/chainlink_test?sslmode=disable
if: ${{ github.event_name == 'schedule' }}
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
with:
build-cache-version: "fuzz"
restore-build-cache-only: "true"
db-url: ${{ env.DB_URL }}

- name: Increase Timeouts
Expand All @@ -206,22 +230,29 @@ jobs:
run-race-tests:
name: Tests (race)
runs-on: ubuntu22.04-32cores-128GB

Check failure on line 232 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)
env:
DB_URL: postgresql://postgres:postgres@localhost:5432/chainlink_test?sslmode=disable
if: ${{ github.event_name == 'schedule' }}
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"
restore-build-cache-only: "true"
db-url: ${{ env.DB_URL }}

- name: Increase Timeouts
Expand Down

0 comments on commit 36bf962

Please sign in to comment.