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

Add sub dir support for Solidity Tests #654

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
5 changes: 5 additions & 0 deletions .changeset/eleven-terms-arrive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ci-test-sol": patch
---

support overriding directory on running Solidity tests
13 changes: 13 additions & 0 deletions actions/ci-test-sol/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ inputs:
description: ""
required: false
default: "--report lcov"
working-directory:
description: "override directory to run tests in"
required: false
default: ""
# nodejs inputs
node-version-file:
description: ""
Expand Down Expand Up @@ -85,6 +89,7 @@ runs:
pnpm-version: ${{ inputs.pnpm-version }}
use-cache: "true"
run-install: "true"
package-json-directory: ${{ inputs.working-directory }}

- name: Setup foundry
uses: foundry-rs/foundry-toolchain@8f1998e9878d786675189ef566a2e4bf24869773 # v1.2.0
Expand All @@ -96,47 +101,55 @@ runs:
run: forge --version

- name: Run build
working-directory: ${{ inputs.working-directory }}
if: inputs.check-only-affected != 'true'
shell: bash
run: pnpm run build ${{ inputs.forge-build-args }}

- name: Run build affected
working-directory: ${{ inputs.working-directory }}
if: inputs.check-only-affected == 'true'
shell: bash
run:
pnpm run build:affected --base=${{ inputs.base-ref }} ${{
inputs.forge-build-args }}

- name: Run test
working-directory: ${{ inputs.working-directory }}
if: inputs.check-only-affected != 'true'
shell: bash
run: pnpm run test ${{ inputs.forge-test-args }}

- name: Run test affected
working-directory: ${{ inputs.working-directory }}
if: inputs.check-only-affected == 'true'
shell: bash
run:
pnpm run test:affected --base=${{ inputs.base-ref }} ${{
inputs.forge-test-args }}

- name: Run snapshot
working-directory: ${{ inputs.working-directory }}
if: inputs.check-only-affected != 'true'
shell: bash
run: pnpm run snapshot ${{ inputs.forge-snapshot-args }}

- name: Run snapshot affected
working-directory: ${{ inputs.working-directory }}
if: inputs.check-only-affected == 'true'
shell: bash
run:
pnpm run snapshot:affected --base=${{ inputs.base-ref }} ${{
inputs.forge-snapshot-args }}

- name: Run coverage
working-directory: ${{ inputs.working-directory }}
if: inputs.check-only-affected != 'true'
shell: bash
run: pnpm run coverage ${{ inputs.forge-coverage-args }}

- name: Run coverage affected
working-directory: ${{ inputs.working-directory }}
if: inputs.check-only-affected == 'true'
shell: bash
run:
Expand Down
Loading