Skip to content

Commit

Permalink
Merge pull request #17 from competitive-verifier/array
Browse files Browse the repository at this point in the history
Accept path with space
  • Loading branch information
kzrnm authored Apr 29, 2024
2 parents b07a9c3 + 53e3c88 commit 9b1f358
Show file tree
Hide file tree
Showing 12 changed files with 146 additions and 34 deletions.
32 changes: 31 additions & 1 deletion .github/workflows/test-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,4 +90,34 @@ jobs:
[ "${{ steps.check-success-subdir.outputs.result-count }}" = "3" ]
[ "${{ steps.check-success-subdir.outputs.result-count-success }}" = "3" ]
[ "${{ steps.check-success-subdir.outputs.result-count-failure }}" = "0" ]
[ "${{ steps.check-success-subdir.outputs.result-count-skipped }}" = "0" ]
[ "${{ steps.check-success-subdir.outputs.result-count-skipped }}" = "0" ]
- name: Check space success
id: check-space-success
uses: ./check
with:
verify-result: |
'check/tests/space X/success.json'
- name: Test space success
run: |
[ "${{ steps.check-space-success.outcome }}" = "success" ]
[ "${{ steps.check-space-success.outputs.result-count }}" = "1" ]
[ "${{ steps.check-space-success.outputs.result-count-success }}" = "1" ]
[ "${{ steps.check-space-success.outputs.result-count-failure }}" = "0" ]
[ "${{ steps.check-space-success.outputs.result-count-skipped }}" = "0" ]
- name: Check space exp
id: check-space-exp
uses: ./check
continue-on-error: true
with:
verify-result: |
check/tests/space\ X/*.json
check/tests/failure-result.json
- name: Test space exp
run: |
[ "${{ steps.check-space-exp.outcome }}" = "failure" ]
[ "${{ steps.check-space-exp.outputs.result-count }}" = "5" ]
[ "${{ steps.check-space-exp.outputs.result-count-success }}" = "2" ]
[ "${{ steps.check-space-exp.outputs.result-count-failure }}" = "2" ]
[ "${{ steps.check-space-exp.outputs.result-count-skipped }}" = "1" ]
5 changes: 2 additions & 3 deletions check/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@ runs:
id: check
working-directory: ${{inputs.working-directory}}
run: |
competitive-verifier check $COMPETITIVE_RESULT_FILES | tee "$RUNNER_TEMP/.temp.competitive-verifier.check.yml"
env:
COMPETITIVE_RESULT_FILES: ${{ inputs.verify-result }}
COMPETITIVE_RESULT_FILES=( ${{ inputs.verify-result }} )
competitive-verifier check "${COMPETITIVE_RESULT_FILES[@]}" | tee "$RUNNER_TEMP/.temp.competitive-verifier.check.yml"
- name: Result
shell: bash
Expand Down
15 changes: 15 additions & 0 deletions check/tests/space X/failure.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"total_seconds": 6.459829,
"files": {
"tests/python/union_find_yosupo3.test.py": {
"verifications": [
{
"status": "failure",
"elapsed": 6.452828,
"last_execution_time": "2022-11-14T02:30:23.293834+09:00"
}
],
"newest": true
}
}
}
15 changes: 15 additions & 0 deletions check/tests/space X/skipped.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"total_seconds": 6.459829,
"files": {
"tests/python/union_find_yosupo2.test.py": {
"verifications": [
{
"status": "skipped",
"elapsed": 6.452828,
"last_execution_time": "2022-11-14T02:30:23.293834+09:00"
}
],
"newest": true
}
}
}
15 changes: 15 additions & 0 deletions check/tests/space X/success.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"total_seconds": 6.459829,
"files": {
"tests/python/union_find_yosupo1.test.py": {
"verifications": [
{
"status": "success",
"elapsed": 6.452828,
"last_execution_time": "2022-11-14T02:30:23.293834+09:00"
}
],
"newest": true
}
}
}
38 changes: 28 additions & 10 deletions cs-resolve/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,38 @@ runs:
id: resolve
working-directory: ${{inputs.working-directory}}
run: |
COMPETITIVE_unittest=(${{ inputs.unittest-result }})
if test "${#COMPETITIVE_unittest[@]}" -ne 0; then
COMPETITIVE_unittest=("--unittest" "${COMPETITIVE_unittest[@]}")
fi
COMPETITIVE_problems=(${{ inputs.problems }})
if test "${#COMPETITIVE_problems[@]}" -ne 0; then
COMPETITIVE_problems=("--problems" "${COMPETITIVE_problems[@]}")
fi
COMPETITIVE_msbuild_props=(${{ inputs.msbuild-properties }})
if test "${#COMPETITIVE_msbuild_props[@]}" -ne 0; then
COMPETITIVE_msbuild_props=("--properties" "${COMPETITIVE_msbuild_props[@]}")
fi
set -f
COMPETITIVE_include=(${{ inputs.include }})
if test "${#COMPETITIVE_include[@]}" -ne 0; then
COMPETITIVE_include=("--include" "${COMPETITIVE_include[@]}")
fi
COMPETITIVE_exclude=(${{ inputs.exclude }})
if test "${#COMPETITIVE_exclude[@]}" -ne 0; then
COMPETITIVE_exclude=("--exclude" "${COMPETITIVE_exclude[@]}")
fi
competitive-verifier-cs-resolver ${{inputs.solution}} \
$(set +f && echo $COMPETITIVE_unittest) \
$(set +f && echo $COMPETITIVE_problems) \
$COMPETITIVE_include \
$COMPETITIVE_exclude \
$COMPETITIVE_msbuild_props \
"${COMPETITIVE_unittest[@]}" \
"${COMPETITIVE_problems[@]}" \
"${COMPETITIVE_include[@]}" \
"${COMPETITIVE_exclude[@]}" \
"${COMPETITIVE_msbuild_props[@]}" \
| tee "$COMPETITIVE_OUTPUT_FILE"
env:
COMPETITIVE_include: ${{ format(inputs.include && '--include {0}', inputs.include) }}
COMPETITIVE_exclude: ${{ format(inputs.exclude && '--exclude {0}', inputs.exclude) }}
COMPETITIVE_unittest: ${{ format(inputs.unittest-result && '--unittest {0}', inputs.unittest-result) }}
COMPETITIVE_problems: ${{ format(inputs.problems && '--problems {0}', inputs.problems) }}
COMPETITIVE_msbuild_props: ${{ format(inputs.msbuild-properties && '--properties {0}', inputs.msbuild-properties) }}
COMPETITIVE_OUTPUT_FILE: ${{ inputs.output-path }}

- name: Path
Expand Down
22 changes: 16 additions & 6 deletions docs/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,26 @@ runs:
id: docs
working-directory: ${{inputs.working-directory}}
run: |
COMPETITIVE_RESULT_FILES="$(echo $COMPETITIVE_RESULT_FILES)"
COMPETITIVE_RESULT_FILES=( ${{ inputs.verify-result }} )
set -f
COMPETITIVE_include=(${{ inputs.include }})
if test "${#COMPETITIVE_include[@]}" -ne 0; then
COMPETITIVE_include=("--include" "${COMPETITIVE_include[@]}")
fi
COMPETITIVE_exclude=(${{ inputs.exclude }})
if test "${#COMPETITIVE_exclude[@]}" -ne 0; then
COMPETITIVE_exclude=("--exclude" "${COMPETITIVE_exclude[@]}")
fi
competitive-verifier docs \
$COMPETITIVE_RESULT_FILES \
"${COMPETITIVE_RESULT_FILES[@]}" \
"${COMPETITIVE_include[@]}" \
"${COMPETITIVE_exclude[@]}" \
${{ fromJson(inputs.write-summary) && '--write-summary' || '' }} \
${{ format(inputs.docs && '--docs {0}', inputs.docs) }} \
--include $COMPETITIVE_include \
--exclude $COMPETITIVE_exclude \
--destination "${{ inputs.destination }}"
env:
COMPETITIVE_include: ${{ inputs.include }}
COMPETITIVE_exclude: ${{ inputs.exclude }}
COMPETITIVE_VERIFY_FILES_PATH: ${{ inputs.verify-files || env.COMPETITIVE_VERIFY_FILES_PATH }}
COMPETITIVE_RESULT_FILES: ${{ inputs.verify-result }}
4 changes: 2 additions & 2 deletions merge-result/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ runs:
shell: bash
working-directory: ${{inputs.working-directory}}
run: |
competitive-verifier merge-result $COMPETITIVE_FILES | tee "$COMPETITIVE_OUTPUT_FILE"
COMPETITIVE_RESULT_FILES=( ${{ inputs.result-files }} )
competitive-verifier merge-result "${COMPETITIVE_RESULT_FILES[@]}" | tee "$COMPETITIVE_OUTPUT_FILE"
env:
COMPETITIVE_FILES: ${{ inputs.result-files }}
COMPETITIVE_OUTPUT_FILE: ${{ inputs.output-path }}

- name: Path
Expand Down
4 changes: 2 additions & 2 deletions merge-verify-files/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ runs:
shell: bash
working-directory: ${{inputs.working-directory}}
run: |
competitive-verifier merge-input $COMPETITIVE_FILES | tee "$COMPETITIVE_OUTPUT_FILE"
COMPETITIVE_FILES=( ${{ inputs.verify-files }} )
competitive-verifier merge-input "${COMPETITIVE_FILES[@]}" | tee "$COMPETITIVE_OUTPUT_FILE"
env:
COMPETITIVE_FILES: ${{ inputs.verify-files }}
COMPETITIVE_OUTPUT_FILE: ${{ inputs.output-path }}

- name: Path
Expand Down
18 changes: 14 additions & 4 deletions oj-resolve/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,22 @@ runs:
working-directory: ${{inputs.working-directory}}
run: |
set -f
competitive-verifier oj-resolve --include $COMPETITIVE_include --exclude $COMPETITIVE_exclude $(set +f && echo $COMPETITIVE_config) | tee "$COMPETITIVE_OUTPUT_FILE"
COMPETITIVE_include=(${{ inputs.include }})
if test "${#COMPETITIVE_include[@]}" -ne 0; then
COMPETITIVE_include=("--include" "${COMPETITIVE_include[@]}")
fi
COMPETITIVE_exclude=(${{ inputs.exclude }})
if test "${#COMPETITIVE_exclude[@]}" -ne 0; then
COMPETITIVE_exclude=("--exclude" "${COMPETITIVE_exclude[@]}")
fi
competitive-verifier oj-resolve \
"${COMPETITIVE_include[@]}" \
"${COMPETITIVE_exclude[@]}" \
${{ format(inputs.config && '--config "{0}"', inputs.config) }} | tee "$COMPETITIVE_OUTPUT_FILE"
echo "json-path=$COMPETITIVE_OUTPUT_FILE" >> $GITHUB_OUTPUT
env:
COMPETITIVE_include: ${{ inputs.include }}
COMPETITIVE_exclude: ${{ inputs.exclude }}
COMPETITIVE_config: ${{ format(inputs.config && '--config {0}', inputs.config) }}
COMPETITIVE_OUTPUT_FILE: ${{ inputs.output-path }}

- name: Path
Expand Down
12 changes: 6 additions & 6 deletions verify/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ runs:
verify --check-error \
${{ fromJson(inputs.verbose) && '--verbose' || '' }} \
${{ fromJson(inputs.write-summary) && '--write-summary' || '' }} \
${{ format(inputs.timeout && '--timeout {0}', inputs.timeout) }} \
${{ format(inputs.tle && '--tle {0}', inputs.tle) }} \
${{ format(inputs.mle && '--mle {0}', inputs.mle) }} \
${{ format(inputs.prev-result && '--prev-result {0}', inputs.prev-result) }} \
${{ format(inputs.split-size && '--split {0}', inputs.split-size) }} \
${{ format(inputs.split-index && '--split-index {0}', inputs.split-index) }} \
${{ format(inputs.timeout && '--timeout "{0}"', inputs.timeout) }} \
${{ format(inputs.tle && '--tle "{0}"', inputs.tle) }} \
${{ format(inputs.mle && '--mle "{0}"', inputs.mle) }} \
${{ format(inputs.prev-result && '--prev-result "{0}"', inputs.prev-result) }} \
${{ format(inputs.split-size && '--split "{0}"', inputs.split-size) }} \
${{ format(inputs.split-index && '--split-index "{0}"', inputs.split-index) }} \
${{ format(inputs.destination && '--output "{0}"', inputs.destination) }} ; then
echo "success=true" >> $GITHUB_OUTPUT
else
Expand Down

0 comments on commit 9b1f358

Please sign in to comment.