Files
judge/.gitea/workflows/build-dsl-smoke.yml
Mikhail Kornilovich 5e0effc6fe refactor: extract expander helpers and Test stdio/file setters
- Add globWithAffixes in runner/expander.go that wraps filepath.Glob
    with an empty-match check and returns the computed prefix/suffix
    from splitGlob, collapsing three near-identical lookup blocks in
    expandGlobPattern into single calls.
  - Extract per-case Test construction from buildTests into a new
    buildTest helper so the loop body is a single call and the read /
    assemble / arg-template logic lives in one place.
  - Add Test.SetInputFile, Test.SetStdin, Test.SetOutputFile and
    Test.SetStdout methods on dsl.Test to encapsulate the stdin-vs-
    InFiles and stdout-vs-OutFiles wiring that buildTest previously
    did inline.
  - Adopt the `for range N` loop form in the determinism check in
    runner/compiler_test.go.
  - Switch the MSVC release test to expect /std:c17 since MSVC does
    not ship a c11 mode (worth surfacing a warning about this later).
2026-04-16 00:28:30 +03:00

145 lines
4.4 KiB
YAML

name: build-dsl-smoke
run-name: "Structured build DSL smoke test"
on:
workflow_dispatch:
env:
SUITE_FILE: sum.jdg
EXAMPLE_DIR: example/c-sum-v2
jobs:
build_judge:
name: Build judge
runs-on: Linux-Runner
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.22'
- name: Cross-compile judge
shell: bash
run: |
mkdir -p dist
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o dist/judge-linux-amd64 ./cmd/cli
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o dist/judge-windows-amd64.exe ./cmd/cli
ls -la dist/
- name: Upload judge binaries
uses: https://github.com/christopherHX/gitea-upload-artifact@v4
with:
name: judge-bin-csum2
path: dist/
retention-days: 1
test:
needs: build_judge
name: "${{ matrix.build }} / ${{ matrix.toolchain }} / ${{ matrix.platform }}"
strategy:
fail-fast: false
matrix:
include:
- { build: release, toolchain: gcc, platform: linux }
- { build: release, toolchain: clang, platform: linux }
- { build: release, toolchain: clang, platform: windows }
- { build: release, toolchain: msvc, platform: windows }
- { build: debug, toolchain: gcc, platform: linux }
- { build: debug, toolchain: clang, platform: linux }
- { build: debug, toolchain: clang, platform: windows }
- { build: debug, toolchain: msvc, platform: windows }
- { build: sanitized, toolchain: gcc, platform: linux }
- { build: sanitized, toolchain: clang, platform: linux }
- { build: debug-valgrind, toolchain: gcc, platform: linux }
runs-on: ${{ matrix.platform == 'windows' && 'Windows-Runner' || 'Linux-Runner' }}
timeout-minutes: 10
env:
REPORT_NAME: "report_${{ matrix.build }}_${{ matrix.toolchain }}_${{ matrix.platform }}"
JUDGE_TOOLCHAIN: ${{ matrix.toolchain }}
steps:
- uses: actions/checkout@v4
- name: Set up MSVC environment
if: matrix.toolchain == 'msvc'
uses: ilammy/msvc-dev-cmd@v1
- name: Download judge binary
uses: https://github.com/christopherHX/gitea-download-artifact@v4
with:
name: judge-bin-csum2
path: judge-bin
- name: Install judge on PATH
shell: bash
run: |
mkdir -p bin
if [ "${{ matrix.platform }}" = "windows" ]; then
cp judge-bin/judge-windows-amd64.exe bin/judge.exe
else
cp judge-bin/judge-linux-amd64 bin/judge
chmod +x bin/judge
fi
echo "$PWD/bin" >> "$GITHUB_PATH"
- name: Run judge
shell: bash
working-directory: ${{ env.EXAMPLE_DIR }}
run: |
judge "$SUITE_FILE" . --build=${{ matrix.build }} --json > "$GITHUB_WORKSPACE/${REPORT_NAME}.json" || true
cat "$GITHUB_WORKSPACE/${REPORT_NAME}.json"
judge "$SUITE_FILE" . --build=${{ matrix.build }}
- name: Upload report
if: ${{ always() }}
uses: https://github.com/christopherHX/gitea-upload-artifact@v4
with:
name: ${{ env.REPORT_NAME }}
path: ${{ env.REPORT_NAME }}.json
retention-days: 7
compression-level: 9
summary:
needs: [build_judge, test]
if: ${{ always() }}
name: SUMMARY
runs-on: Linux-Runner
timeout-minutes: 5
steps:
- name: Download judge binary
uses: https://github.com/christopherHX/gitea-download-artifact@v4
with:
name: judge-bin-csum2
path: judge-bin
- name: Install judge on PATH
shell: bash
run: |
mkdir -p bin
cp judge-bin/judge-linux-amd64 bin/judge
chmod +x bin/judge
echo "$PWD/bin" >> "$GITHUB_PATH"
- name: Download all reports
uses: https://github.com/christopherHX/gitea-download-artifact@v4
with:
path: reports
pattern: report_*
- name: Aggregate
shell: bash
run: judge aggregate reports | tee SUMMARY.md
- name: Upload summary
uses: https://github.com/christopherHX/gitea-upload-artifact@v4
with:
name: SUMMARY
path: SUMMARY.md
retention-days: 7