Skip to content

Test workflow dispatch #5922

Test workflow dispatch

Test workflow dispatch #5922

Workflow file for this run

# This GitHub Action flow works as follows:
# Each directory in the examples and tests directory represents an example project and is intended to have tests that ensure the canisters contained in that example function properly.
# These tests are currently written in TypeScript and are intended to be run in a Node.js environment.
# This GitHub Action takes care of deploying to npm and GitHub.
name: Test
on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
- ready_for_review
- reopened
workflow_dispatch:
inputs:
fuzz:
description: 'Run fuzz tests'
required: true
type: boolean
default: false
exclude-slow-tests:
description: 'Exclude slow tests'
required: true
type: boolean
default: true
exclude-unstable-tests:
description: 'Exclude unstable tests'
required: true
type: boolean
default: true
exclude-release-only-tests:
description: 'Exclude release only tests'
required: true
type: boolean
default: true
link-azle:
description: 'Link to development version of azle'
required: true
type: boolean
default: true
jobs:
process-conditions:
name: Process test conditions
runs-on: ubuntu-latest
outputs:
exclude-slow: ${{ steps.process-conditions.outputs.exclude-slow }}
exclude-unstable: ${{ steps.process-conditions.outputs.exclude-unstable }}
exclude-release-only: ${{ steps.process-conditions.outputs.exclude-release-only }}
link-azle: ${{ steps.process-conditions.outputs.link-azle }}
fuzz: ${{ steps.process-conditions.outputs.fuzz }}
steps:
- uses: actions/checkout@v4
- id: process-conditions
uses: ./.github/actions/process_test_conditions
with:
is-workflow-dispatch: ${{ github.event_name == 'workflow_dispatch' }}
exclude-slow-dispatch-input-value: ${{ inputs.exclude-slow-tests }}
exclude-unstable-dispatch-input-value: ${{ inputs.exclude-unstable-tests }}
exclude-release-only-dispatch-input-value: ${{ inputs.exclude-release-only-tests }}
link-azle-dispatch-input-value: ${{ inputs.link-azle }}
fuzz-dispatch-input-value: ${{ inputs.fuzz }}
get-exclude-dirs:
name: Get exclude directories
needs: process-conditions
runs-on: ubuntu-latest
outputs:
exclude-dirs: ${{ steps.get-exclude-dirs.outputs.exclude-dirs }}
steps:
- uses: actions/checkout@v4
- id: get-exclude-dirs
uses: ./.github/actions/get_exclude_dirs
with:
exclude-slow: ${{ needs.process-conditions.outputs.exclude-slow }}
exclude-unstable: ${{ needs.process-conditions.outputs.exclude-unstable }}
exclude-release-only: ${{ needs.process-conditions.outputs.exclude-release-only }}
run-tests:
name: ${{ matrix.test_group.name }}
runs-on: ubuntu-latest
needs:
- process-conditions
- get-exclude-dirs
strategy:
fail-fast: false
matrix:
test_group:
- { name: 'Examples', directories: './examples' }
- {
name: 'Examples (Experimental)',
directories: './examples',
run-experimental: true
}
- {
name: 'E2E Class',
directories: './tests/end_to_end/candid_rpc/class_syntax'
}
- {
name: 'E2E Class (Experimental)',
directories: './tests/end_to_end/candid_rpc/class_syntax',
run-experimental: true
}
- {
name: 'E2E Functional',
directories: './tests/end_to_end/candid_rpc/functional_syntax'
}
- {
name: 'E2E HTTP Server',
directories: './tests/end_to_end/http_server'
}
- {
name: 'Property Class',
directories: './tests/property/candid_rpc/class_api'
}
- {
name: 'Property Class (Experimental)',
directories: './tests/property/candid_rpc/class_api',
run-experimental: true
}
- {
name: 'Property Functional',
directories: './tests/property/candid_rpc/functional_api'
}
- {
name: 'Property IC API',
directories: './tests/property/ic_api'
}
- {
name: 'Property IC API (Experimental)',
directories: './tests/property/ic_api',
run-experimental: true
}
steps:
- uses: actions/checkout@v4
- id: get-test-infos
uses: ./.github/actions/get_test_infos
with:
directories: ${{ matrix.test_group.directories }}
exclude-dirs: ${{ needs.get-exclude-dirs.outputs.exclude-dirs }}
- uses: ./.github/workflows/run_test.yml
with:
test_infos: ${{ steps.get-test-infos.outputs.test-infos }}
link-azle: ${{ needs.process-conditions.outputs.link-azle == 'true' }}
run-experimental: ${{ matrix.test_group.run-experimental || false }}
fuzz: ${{ needs.process-conditions.outputs.fuzz == 'true' }}
check-test-success:
name: Check Azle tests succeeded
needs: run-tests
runs-on: ubuntu-latest
if: success()
steps:
- run: exit 0
check-test-failure:
name: Check Azle tests didn't fail
needs: run-tests
runs-on: ubuntu-latest
if: failure()
steps:
- run: exit 1