add new build system
All checks were successful
build-dsl-smoke / Discover matrix (push) Successful in 8s
build-dsl-smoke / Build judge (push) Successful in 11s
build-dsl-smoke / ${{ matrix.cell.build }} / ${{ matrix.cell.toolchain }} / ${{ matrix.cell.platform }} (push) Successful in 5s
memory-limit / Build judge (pull_request) Successful in 10s
build-dsl-smoke / SUMMARY (push) Successful in 3s
memory-limit / Linux / gcc (pull_request) Successful in 9s
memory-limit / Linux / clang (pull_request) Successful in 13s
memory-limit / Windows / clang (pull_request) Successful in 16s
memory-limit / Windows / msvc (pull_request) Successful in 17s
All checks were successful
build-dsl-smoke / Discover matrix (push) Successful in 8s
build-dsl-smoke / Build judge (push) Successful in 11s
build-dsl-smoke / ${{ matrix.cell.build }} / ${{ matrix.cell.toolchain }} / ${{ matrix.cell.platform }} (push) Successful in 5s
memory-limit / Build judge (pull_request) Successful in 10s
build-dsl-smoke / SUMMARY (push) Successful in 3s
memory-limit / Linux / gcc (pull_request) Successful in 9s
memory-limit / Linux / clang (pull_request) Successful in 13s
memory-limit / Windows / clang (pull_request) Successful in 16s
memory-limit / Windows / msvc (pull_request) Successful in 17s
This commit is contained in:
162
.gitea/workflows/build-dsl-smoke.yml
Normal file
162
.gitea/workflows/build-dsl-smoke.yml
Normal file
@@ -0,0 +1,162 @@
|
||||
name: build-dsl-smoke
|
||||
run-name: "Structured build DSL smoke test"
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'dsl/**'
|
||||
- 'runner/**'
|
||||
- 'reporter/**'
|
||||
- 'cmd/cli/**'
|
||||
- 'example/c-sum-v2/**'
|
||||
- '.gitea/workflows/build-dsl-smoke.yml'
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
SUITE_FILE: sum.jdg
|
||||
EXAMPLE_DIR: example/c-sum-v2
|
||||
|
||||
jobs:
|
||||
discover:
|
||||
name: Discover matrix
|
||||
runs-on: Linux-Runner
|
||||
timeout-minutes: 5
|
||||
outputs:
|
||||
matrix: ${{ steps.list.outputs.matrix }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions/setup-go@v5
|
||||
with:
|
||||
go-version: '1.22'
|
||||
|
||||
- name: List matrix from .jdg
|
||||
id: list
|
||||
shell: bash
|
||||
run: |
|
||||
matrix=$(go run ./cmd/cli --list-matrix "$EXAMPLE_DIR/$SUITE_FILE")
|
||||
echo "discovered: $matrix"
|
||||
echo "matrix=$matrix" >> "$GITHUB_OUTPUT"
|
||||
|
||||
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: [discover, build_judge]
|
||||
name: "${{ matrix.cell.build }} / ${{ matrix.cell.toolchain }} / ${{ matrix.cell.platform }}"
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
cell: ${{ fromJSON(needs.discover.outputs.matrix) }}
|
||||
|
||||
runs-on: ${{ matrix.cell.platform == 'windows' && 'Windows-Runner' || 'Linux-Runner' }}
|
||||
timeout-minutes: 10
|
||||
|
||||
env:
|
||||
REPORT_NAME: "report_${{ matrix.cell.build }}_${{ matrix.cell.toolchain }}_${{ matrix.cell.platform }}"
|
||||
JUDGE_TOOLCHAIN: ${{ matrix.cell.toolchain }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up MSVC environment
|
||||
if: matrix.cell.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.cell.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.cell.build }} --json > "$GITHUB_WORKSPACE/${REPORT_NAME}.json" || true
|
||||
cat "$GITHUB_WORKSPACE/${REPORT_NAME}.json"
|
||||
judge "$SUITE_FILE" . --build=${{ matrix.cell.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
|
||||
Reference in New Issue
Block a user