diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..319a0a1 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,45 @@ +name: Build + +on: + push: + pull_request: + +jobs: + build: + strategy: + matrix: + compiler: + - { name: gcc, version: 11} + - { name: gcc, version: 12} + - { name: gcc, version: 13} + - { name: gcc, version: 14} + - { name: clang, version: 16} + - { name: clang, version: 17} + - { name: clang, version: 18} + name: Build (${{ matrix.compiler.name }} ${{ matrix.compiler.version }}) + runs-on: ubuntu-24.04 + steps: + - name: Install dependencies + run: | + sudo add-apt-repository universe + sudo apt-get update + sudo apt-get install --assume-yes --no-install-recommends ca-certificates cmake git + - name: Install GCC + if: ${{ matrix.compiler.name == 'gcc' }} + run: | + sudo apt-get install --assume-yes --no-install-recommends gcc-${{ matrix.compiler.version }} g++-${{ matrix.compiler.version }} + echo "CC=/usr/bin/gcc-${{ matrix.compiler.version }}" >> $GITHUB_ENV + echo "CXX=/usr/bin/g++-${{ matrix.compiler.version }}" >> $GITHUB_ENV + - name: Install Clang + if: ${{ matrix.compiler.name == 'clang' }} + run: | + sudo apt-get install --assume-yes --no-install-recommends clang-${{ matrix.compiler.version }} + echo "CC=/usr/bin/clang-${{ matrix.compiler.version }}" >> $GITHUB_ENV + echo "CXX=/usr/bin/clang++-${{ matrix.compiler.version }}" >> $GITHUB_ENV + - uses: actions/checkout@v4 + with: + submodules: recursive + - name: Build + run: | + cmake -B ./build + cmake --build ./build --parallel diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 535383e..921f278 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -13,40 +13,19 @@ jobs: contents: read security-events: write - strategy: - fail-fast: false - matrix: - language: [ 'cpp' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ] - # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support - steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 + with: + submodules: recursive - # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v2 with: - languages: ${{ matrix.language }} - - # Compile - - name: Checkout submodules - run: git submodule update --init --recursive - - - name: Creating build directory - run: cmake -E make_directory ./build - - - name: Run CMake - working-directory: ./build - run: cmake .. -DCMAKE_BUILD_TYPE=Release - - - name: Compilation - working-directory: ./build - run: cmake --build . --config Release + languages: 'cpp' # Perform Analysis - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v2 with: - category: "/language:${{matrix.language}}" + category: "/language:cpp"