diff options
| author | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-16 10:51:43 +0000 |
|---|---|---|
| committer | Zuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian> | 2026-01-16 10:51:43 +0000 |
| commit | d320a5acb137f85dce7a95d1d81cf58bd2796088 (patch) | |
| tree | 20555b4bb65d1abf74b1c2d1053831c88c90d8e7 /.github | |
| parent | eee985160ea23e0ad0d51c15f3ccb1ab79e49978 (diff) | |
Added new workflow for Github Actions
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/manual_test.yml | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/.github/workflows/manual_test.yml b/.github/workflows/manual_test.yml new file mode 100644 index 0000000..b961d7e --- /dev/null +++ b/.github/workflows/manual_test.yml @@ -0,0 +1,79 @@ +name: Manual Test Dispatch + +on: + workflow_dispatch: + inputs: + os: + description: 'Operating System' + required: true + default: 'ubuntu-latest' + type: choice + options: + - ubuntu-latest + - macos-latest + - macos-13 + - windows-latest + compiler: + description: 'Compiler' + required: true + default: 'gcc' + type: choice + options: + - gcc + - clang + test_file: + description: 'Specific test file to run (or "all")' + required: true + default: 'all' + type: string + extra_flags: + description: 'Extra compiler flags' + required: false + default: '' + type: string + +jobs: + manual-test: + runs-on: ${{ inputs.os }} + steps: + - uses: actions/checkout@v4 + + - name: Setup Compiler Environment + shell: bash + run: | + echo "Setting up environment for ${{ inputs.os }} using ${{ inputs.compiler }}" + if [[ "${{ inputs.os }}" == "macos"* ]]; then + if [[ "${{ inputs.compiler }}" == "gcc" ]]; then + echo "Providing GCC on macOS" + # macOS runners usually have gcc alias to clang, but we might want real gcc-12 etc if available + # For now we will rely on system default or brew if strictly needed. + # brew install gcc + fi + fi + + - name: Build Compiler + shell: bash + run: make + + - name: Run Tests + shell: bash + run: | + TEST_TARGET="${{ inputs.test_file }}" + COMPILER="${{ inputs.compiler }}" + FLAGS="${{ inputs.extra_flags }}" + + echo "Running tests..." + echo "Target: $TEST_TARGET" + echo "Compiler: $COMPILER" + + if [ "$TEST_TARGET" = "all" ]; then + ./tests/run_tests.sh --cc $COMPILER + else + if [ ! -f "$TEST_TARGET" ]; then + echo "Error: Test file '$TEST_TARGET' not found." + echo "Available tests:" + find tests -name "*.zc" + exit 1 + fi + ./zc run "$TEST_TARGET" --cc $COMPILER $FLAGS + fi |
