Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: conditionally run unit tests #15347

Merged
merged 9 commits into from
Dec 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: dont modify ci-core.yml
Did some testing trying to see if I could speed up test binary building
through caching. It seems like the cache saving doesn't work when the
composite action is nested.
  • Loading branch information
erikburt committed Dec 7, 2024
commit 460a75a60a18d4e7678436ecdbd1d3b3b305e629
69 changes: 62 additions & 7 deletions .github/workflows/ci-core.yml
Original file line number Diff line number Diff line change
@@ -154,19 +154,74 @@ jobs:
uses: actions/checkout@v4.2.1

- 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