Skip to content

Commit

Permalink
Fix workflow (#163)
Browse files Browse the repository at this point in the history
* Fix workflow

* swap linux wf to local

* codefactor

* fix path

* drop foreign action when local.
  • Loading branch information
Ivo Elezović authored Jan 3, 2022
1 parent 0530593 commit 9bd4851
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 36 deletions.
71 changes: 41 additions & 30 deletions .github/workflows/linux_codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
5 changes: 0 additions & 5 deletions .github/workflows/windows_build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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\"
Expand Down
2 changes: 1 addition & 1 deletion tests/build_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 8 additions & 0 deletions tests/build_linux_foreign.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9bd4851

Please sign in to comment.