Skip to content

Commit

Permalink
update inputs to generate tests action
Browse files Browse the repository at this point in the history
  • Loading branch information
bdemann committed Aug 29, 2024
1 parent 2ec43fb commit eb9197e
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
18 changes: 16 additions & 2 deletions .github/actions/generate_tests/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
name: Generate Tests
description: Generates a list of directories of npm projects with a tests script
inputs:
directories:
description: List of directories to search for npm projects with tests.
required: true
exclude_dirs:
description: List of directories to exclude from the search.
required: false
default: ''
outputs:
all_tests:
description: All of the tests found by this action
Expand All @@ -8,8 +16,14 @@ runs:
using: composite
steps:
- uses: actions/checkout@v4

- name: Generate Tests
id: get_all_tests
# Automatically find all azle tests
run: echo "all_tests=$(./.github/scripts/generate_tests.sh | base64 -d)" >> "$GITHUB_OUTPUT"
run: |
# Export the input variables to make them available to the script
export INPUT_DIRECTORIES="${{ inputs.directories }}"
export INPUT_EXCLUDE_DIRS="${{ inputs.exclude_dirs }}"
# Run the script
all_tests=$(./.github/scripts/generate_tests.sh | base64 -d)
echo "all_tests=${all_tests}" >> "$GITHUB_OUTPUT"
shell: bash
15 changes: 15 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
pull_request: # Runs on pull requests to any branch
env:
IS_RELEASE_CANDIDATE: ${{ contains(github.head_ref, 'release--') }}
IS_FEATURE: ${{ !contains(github.head_ref, 'release--') }}
DFX_VERSION: 0.21.0
NODE_VERSION: 20
jobs:
Expand All @@ -25,6 +26,20 @@ jobs:
- name: Generate Tests
id: get_all_tests
uses: ./.github/actions/generate_tests
with:
directories: |
./examples
./tests
exclude_dirs: ${{ env.IS_FEATURE == 'true' && format('
./examples/basic_bitcoin
./examples/bitcoin_psbt
./examples/ckbtc
./tests/end_to_end/http_server/ethers_base
./tests/end_to_end/http_server/http_outcall_fetch
./tests/end_to_end/http_server/ic_evm_rpc
./tests/property/candid_rpc/class_api/stable_b_tree_map
./tests/property/candid_rpc/functional_api/stable_b_tree_map
') || '' }}
determine-should-run-tests:
name: Determine If Tests Should Run
Expand Down

0 comments on commit eb9197e

Please sign in to comment.