From 9bd4851d784f84616c1c61255443e37183b383de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ivo=20Elezovi=C4=87?= Date: Mon, 3 Jan 2022 14:30:09 +0100 Subject: [PATCH] Fix workflow (#163) * Fix workflow * swap linux wf to local * codefactor * fix path * drop foreign action when local. --- .github/workflows/linux_codeql-analysis.yml | 71 +++++++++++--------- .github/workflows/windows_build_and_test.yml | 5 -- tests/build_linux.sh | 2 +- tests/build_linux_foreign.sh | 8 +++ 4 files changed, 50 insertions(+), 36 deletions(-) create mode 100644 tests/build_linux_foreign.sh diff --git a/.github/workflows/linux_codeql-analysis.yml b/.github/workflows/linux_codeql-analysis.yml index e7f591c0..224f769c 100644 --- a/.github/workflows/linux_codeql-analysis.yml +++ b/.github/workflows/linux_codeql-analysis.yml @@ -1,56 +1,67 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# name: "CodeQL" on: push: - branches: [ master, oldParser ] + branches: [ master ] pull_request: - # The branches below must be a subset of the branches above branches: [ master ] + schedule: + - cron: '0 16 * * 6' jobs: + analyze_main: + name: Analyze Local + if: github.repository_owner == 'ParadoxGameConverters' + runs-on: [self-hosted, linux] + + strategy: + fail-fast: false + matrix: + language: ['cpp'] + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 + submodules: recursive + + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + + - name: Build solution + run: | + cd tests + chmod u+x build_linux.sh + ./build_linux.sh + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 + + - name: Cleanup + uses: colpal/actions-clean@v1 + if: ${{ true }} # To ensure this step runs even when earlier steps fail + analyze: name: Analyze + if: github.repository_owner != 'ParadoxGameConverters' runs-on: ubuntu-latest strategy: fail-fast: false matrix: language: [ 'cpp' ] - # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] - # Learn more: - # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed steps: - name: Checkout repository uses: actions/checkout@v2 - # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL uses: github/codeql-action/init@v1 with: languages: ${{ matrix.language }} - # If you wish to specify custom queries, you can do so here or in a config file. - # By default, queries listed here will override any specified in a config file. - # Prefix the list here with "+" to use these queries and those in the config file. - # queries: ./path/to/local/query, your-org/your-repo/queries@main - - # ℹī¸ Command-line programs to run using the OS shell. - # 📚 https://git.io/JvXDl - - # ✏ī¸ If the Autobuild fails above, remove it and uncomment the following three lines - # and modify them (or add more) to build your code if your project - # uses a compiled language - run: | git submodule update --init --recursive @@ -68,9 +79,9 @@ jobs: # Check versions of gcc, g++ and cmake gcc -v && g++ -v && cmake --version # Run your build commands next - chmod u+x ./tests/build_linux.sh + chmod u+x ./tests/build_linux_foreign.sh cd tests - bash ./build_linux.sh + bash ./build_linux_foreign.sh - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v1 diff --git a/.github/workflows/windows_build_and_test.yml b/.github/workflows/windows_build_and_test.yml index 72d6686c..02dac168 100644 --- a/.github/workflows/windows_build_and_test.yml +++ b/.github/workflows/windows_build_and_test.yml @@ -19,11 +19,6 @@ jobs: fetch-depth: 0 submodules: recursive - - name: "Get previous tag" - if: ${{ github.event_name == 'push' }} - id: previoustag - uses: "WyriHaximus/github-action-get-previous-tag@v1" - - name: "Build solution" run: | cd "C:\Program Files\Microsoft Visual Studio\2022\Community\Msbuild\Current\Bin\" diff --git a/tests/build_linux.sh b/tests/build_linux.sh index b8048dfa..c38551d7 100644 --- a/tests/build_linux.sh +++ b/tests/build_linux.sh @@ -5,4 +5,4 @@ export CC=/usr/bin/gcc-11 && export CXX=/usr/bin/g++-11 && cmake -H. -Bbuild && -cmake --build build -- -j3 +cmake --build build -- -j40 diff --git a/tests/build_linux_foreign.sh b/tests/build_linux_foreign.sh new file mode 100644 index 00000000..b8048dfa --- /dev/null +++ b/tests/build_linux_foreign.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# shellcheck disable=SC2103 + +export CC=/usr/bin/gcc-11 && +export CXX=/usr/bin/g++-11 && + +cmake -H. -Bbuild && +cmake --build build -- -j3