Run tests #45
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Run tests | |
on: | |
workflow_dispatch: | |
inputs: | |
ubuntu-version: | |
description: 'Run tests on Ubuntu' | |
required: false | |
type: choice | |
default: '' | |
options: ['', 'ubuntu-22.04', 'ubuntu-20.04'] | |
macos-version: | |
description: 'Run tests on macOS' | |
required: false | |
type: choice | |
default: '' | |
options: ['', 'macos-13', 'macos-12', 'macos-11'] | |
windows-version: | |
description: 'Run tests on Windows' | |
required: false | |
type: choice | |
default: '' | |
options: ['', 'windows-2022', 'windows-2019'] | |
targets: | |
description: 'Test targets' | |
required: false | |
type: string | |
default: 'core swig-py swig-pl swig-rb javahl bindings' | |
subversion-repository: | |
required: true | |
default: apache/subversion | |
subversion-ref: | |
required: true | |
default: 'trunk' | |
subversion-archive: | |
required: false | |
default: '' | |
sqlite-archive: | |
required: true | |
default: 'https://www.sqlite.org/2022/sqlite-amalgamation-3390400.zip' | |
dependencies: | |
required: true | |
default: 'py3c=v1.4 apr=1.7.4 apr-util=1.6.3 httpd=2.4.58 serf=1.3.10' | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
outputs: | |
ubuntu-version: ${{ steps.convert.outputs.ubuntu-version }} | |
macos-version: ${{ steps.convert.outputs.macos-version }} | |
windows-version: ${{ steps.convert.outputs.windows-version }} | |
targets: ${{ steps.convert.outputs.targets }} | |
dependencies: ${{ steps.convert.outputs.dependencies }} | |
steps: | |
- name: Show inputs | |
env: | |
INPUTS: ${{ toJSON(inputs) }} | |
run: | | |
set -ex | |
{ | |
echo '### Inputs:' | |
echo '```json' | |
echo "$INPUTS" | |
echo '```' | |
} >>"$GITHUB_STEP_SUMMARY" | |
- name: Convert inputs to json outputs | |
id: convert | |
env: | |
INPUTS: ${{ toJSON(inputs) }} | |
run: | | |
set -ex | |
words_json() { | |
local name="$1" | |
local value="$( | |
echo "$INPUTS" | | |
jq -Mc '."'"$name"'" | split(" ")' | |
)" | |
echo "$name=$value" | |
} | |
pairs_json() { | |
local name="$1" | |
local value="$( | |
echo "$INPUTS" | | |
jq -Mc '."'"$name"'" | split(" ") | map(split("=") | {(.[0]): .[1]}) | add' | |
)" | |
echo "$name=$value" | |
} | |
{ | |
words_json 'ubuntu-version' | |
words_json 'macos-version' | |
words_json 'windows-version' | |
words_json 'targets' | |
pairs_json 'dependencies' | |
} >>"$GITHUB_OUTPUT" | |
test-ubuntu: | |
if: ${{ inputs.ubuntu-version }} | |
needs: setup | |
uses: ./.github/workflows/test-ubuntu.yml | |
with: | |
targets: ${{ needs.setup.outputs.targets }} | |
os: ${{ needs.setup.outputs.ubuntu-version }} | |
subversion-repository: ${{ inputs.subversion-repository }} | |
subversion-ref: ${{ inputs.subversion-ref }} | |
subversion-archive: ${{ inputs.subversion-archive }} | |
dependencies: ${{ needs.setup.outputs.dependencies }} | |
test-macos: | |
if: ${{ inputs.macos-version }} | |
needs: setup | |
uses: ./.github/workflows/test-macos.yml | |
with: | |
targets: ${{ needs.setup.outputs.targets }} | |
os: ${{ needs.setup.outputs.macos-version }} | |
subversion-repository: ${{ inputs.subversion-repository }} | |
subversion-ref: ${{ inputs.subversion-ref }} | |
subversion-archive: ${{ inputs.subversion-archive }} | |
dependencies: ${{ needs.setup.outputs.dependencies }} | |
test-windows: | |
if: ${{ inputs.windows-version }} | |
needs: setup | |
uses: ./.github/workflows/test-windows.yml | |
with: | |
targets: ${{ needs.setup.outputs.targets }} | |
os: ${{ needs.setup.outputs.windows-version }} | |
subversion-repository: ${{ inputs.subversion-repository }} | |
subversion-ref: ${{ inputs.subversion-ref }} | |
subversion-archive: ${{ inputs.subversion-archive }} | |
sqlite-archive: ${{ inputs.sqlite-archive }} | |
dependencies: ${{ needs.setup.outputs.dependencies }} |