From 0b307d3167f29808221a714fc0ad5980e746e2d6 Mon Sep 17 00:00:00 2001 From: Harrand Date: Sat, 18 May 2024 16:58:26 +0100 Subject: [PATCH] [ci] attempt to re-do CI using strategy matrix --- .github/workflows/build_clang.yml | 28 ------------------- .github/workflows/build_gcc.yml | 31 --------------------- .github/workflows/build_linux.yml | 34 ++++++++++++++++++++++++ .github/workflows/code_build_debug.yml | 17 ------------ .github/workflows/code_build_release.yml | 17 ------------ 5 files changed, 34 insertions(+), 93 deletions(-) delete mode 100644 .github/workflows/build_clang.yml delete mode 100644 .github/workflows/build_gcc.yml create mode 100644 .github/workflows/build_linux.yml delete mode 100644 .github/workflows/code_build_debug.yml delete mode 100644 .github/workflows/code_build_release.yml diff --git a/.github/workflows/build_clang.yml b/.github/workflows/build_clang.yml deleted file mode 100644 index e253c8d..0000000 --- a/.github/workflows/build_clang.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: "clang" -on: - workflow_call: - inputs: - build_config: - required: true - type: string - -jobs: - build: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - - - name: 'Automatic LLVM Install' - run: sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" - - - name: 'Configure psyc clang_${{inputs.build_config}}' - run: cmake --preset ci_${{inputs.build_config}} -DCMAKE_CXX_COMPILER=clang++-18 -DCMAKE_C_COMPILER=clang-18 - working-directory: cpp - - - name: 'Build psyc clang_${{inputs.build_config}}' - run: cmake --build ./build/ci_${{inputs.build_config}} --target psyc - working-directory: cpp - - - name: 'Compile a simple test program' - run: ./cpp/build/ci_${{inputs.build_config}}/psyc -v ./samples/scratchpad.psy --dump-ast --dump-ir - diff --git a/.github/workflows/build_gcc.yml b/.github/workflows/build_gcc.yml deleted file mode 100644 index 1366e34..0000000 --- a/.github/workflows/build_gcc.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: "gcc" -on: - workflow_call: - inputs: - build_config: - required: true - type: string - -jobs: - build: - runs-on: ubuntu-24.04 - steps: - - uses: actions/checkout@v4 - - - name: 'Automatic LLVM Install' - run: sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" - - - name: 'Install newer GCC' - run: sudo apt install gcc-13 - - - name: 'Configure psyc gcc_${{inputs.build_config}}' - run: cmake --preset ci_${{inputs.build_config}} -DCMAKE_CXX_COMPILER=g++-13 -DCMAKE_C_COMPILER=gcc-13 - working-directory: cpp - - - name: 'Build psyc gcc_${{inputs.build_config}}' - run: cmake --build ./build/ci_${{inputs.build_config}} --target psyc - working-directory: cpp - - - name: 'Compile a simple test program' - run: ./cpp/build/ci_${{inputs.build_config}}/psyc -v ./samples/scratchpad.psy --dump-ast --dump-ir - diff --git a/.github/workflows/build_linux.yml b/.github/workflows/build_linux.yml new file mode 100644 index 0000000..7edfc30 --- /dev/null +++ b/.github/workflows/build_linux.yml @@ -0,0 +1,34 @@ +name: "linux" +on: + push: + branches: [ master ] + workflow_dispatch: + +jobs: + build: + strategy: + matrix: + build_config: ['debug', 'release'] + compiler: ['clang-18', 'gcc-13'] + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + + - name: 'Automatic LLVM Install' + run: sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" + + - name: 'Install newer GCC' + run: sudo apt install gcc-13 + if: ${{ startsWith(${{ matrix.compiler }}, 'gcc') }} + + - name: 'Configure psyc ${{ matrix.compiler }}_${{ matrix.build_config }}' + run: cmake --preset ci_${{ matrix.build_config }} -DCMAKE_CXX_COMPILER=${{ matrix.compiler }} -DCMAKE_C_COMPILER=${{ matrix.compiler }} + working-directory: cpp + + - name: 'Build psyc ${{ matrix.compiler }}_${{ matrix.build_config }}' + run: cmake --build ./build/ci_${{ matrix.build_config }} --target psyc + working-directory: cpp + + - name: 'Compile a simple test program' + run: ./cpp/build/ci_${{ matrix.build_config }}/psyc -v ./samples/scratchpad.psy --dump-ast --dump-ir + diff --git a/.github/workflows/code_build_debug.yml b/.github/workflows/code_build_debug.yml deleted file mode 100644 index 02b40ad..0000000 --- a/.github/workflows/code_build_debug.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: "code build (debug)" - -on: - push: - branches: [ master ] - workflow_dispatch: - -jobs: - debug_clang_linux: - uses: Harrand/psyc/.github/workflows/build_clang.yml@master - with: - build_config: debug - - debug_gcc_linux: - uses: Harrand/psyc/.github/workflows/build_gcc.yml@master - with: - build_config: debug \ No newline at end of file diff --git a/.github/workflows/code_build_release.yml b/.github/workflows/code_build_release.yml deleted file mode 100644 index 55c3f74..0000000 --- a/.github/workflows/code_build_release.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: "code build (release)" - -on: - push: - branches: [ master ] - workflow_dispatch: - -jobs: - release_clang_linux: - uses: Harrand/psyc/.github/workflows/build_clang.yml@master - with: - build_config: release - - release_gcc_linux: - uses: Harrand/psyc/.github/workflows/build_gcc.yml@master - with: - build_config: release \ No newline at end of file