Skip to content

Commit

Permalink
Merge pull request #893 from utilForever/update-ci
Browse files Browse the repository at this point in the history
Update GitHub Actions Images
  • Loading branch information
utilForever authored May 26, 2024
2 parents 7ebbb70 + d1dd207 commit 1fad377
Show file tree
Hide file tree
Showing 7 changed files with 72 additions and 115 deletions.
52 changes: 26 additions & 26 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,31 @@ jobs:
strategy:
matrix:
include:
# macOS 12.6.5 + Xcode 14.2
- name: "macOS 12.6.5 + Xcode 14.2"
os: macos-12
# macOS 14 + Xcode 15.4
- name: "macOS 14 + Xcode 15.4"
os: macos-14
compiler: xcode
version: "14.2"
# macOS 12.6.5 + Xcode 13.4.1
- name: "macOS 12.6.5 + Xcode 13.4.1"
os: macos-12
version: "15.4"
# macOS 14 + Xcode 15.0.1
- name: "macOS 14 + Xcode 15.0.1"
os: macos-14
compiler: xcode
version: "13.4.1"
# macOS 11.7.6 + Xcode 12.5.1
- name: "macOS 11.7.6 + Xcode 12.5.1"
os: macos-11
compiler: xcode
version: "12.5.1"
# macOS 12.6.5 + gcc-12
- name: "macOS 12.6.5 + gcc-12"
os: macos-12
version: "15.0.1"
# macOS 14 + gcc-13
# - name: "macOS 14 + gcc-13"
# os: macos-14
# compiler: gcc
# version: "13"
# macOS 14 + gcc-12
- name: "macOS 14 + gcc-12"
os: macos-14
compiler: gcc
version: "12"
# macOS 12.6.5 + gcc-11
- name: "macOS 12.6.5 + gcc-11"
os: macos-12
# macOS 14 + gcc-11
- name: "macOS 14 + gcc-11"
os: macos-14
compiler: gcc
version: "11"
# macOS 11.7.6 + gcc-10
- name: "macOS 11.7.6 + gcc-10"
os: macos-11
compiler: gcc
version: "10"

runs-on: ${{ matrix.os }}
name: 🍎 Build - ${{ matrix.name }}
Expand All @@ -49,6 +44,11 @@ jobs:
- uses: actions/checkout@v1
with:
submodules: true
# NOTE: Linker ICEs with Xcode 15.0.1 (default version on macos-14)
# Remove this step if the default gets changed to 15.1 in actions/runner-images.
- name: Switch to Xcode v15.1
if: matrix.compiler == 'gcc'
run: sudo xcode-select -switch /Applications/Xcode_15.1.app
- name: Configure Compiler
run: |
if [ "${{ matrix.compiler }}" = "gcc" ]; then
Expand All @@ -68,6 +68,6 @@ jobs:
run: /Users/runner/work/RosettaStone/RosettaStone/build/bin/UnitTests
- name: Run Python Test
run: |
pip3 install -r requirements.txt
pip3 install .
pip3 install -r requirements.txt --break-system-packages
pip3 install . --break-system-packages
python3 -m pytest Tests/PythonTests/
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu-codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ jobs:
- name: Run Unit Test
run: /home/runner/work/RosettaStone/RosettaStone/build/bin/UnitTests
- name: Upload coverage to Codecov
run: bash <(curl -s https://codecov.io/bash)
run: bash <(curl -s https://codecov.io/bash)
77 changes: 22 additions & 55 deletions .github/workflows/ubuntu-sonarcloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,62 +4,29 @@ on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
types: [ opened, synchronize, reopened ]

jobs:
build-ubuntu:
runs-on: ${{ matrix.os }}
build:
name: 🌞 Static Analysis - SonarCloud
strategy:
matrix:
include:
# Ubuntu 20.04 + gcc-10
- name: "Ubuntu 20.04 + gcc-10"
os: ubuntu-20.04
compiler: gcc
version: "10"
runs-on: ubuntu-latest
env:
BUILD_WRAPPER_OUT_DIR: bw-output # Directory where build-wrapper output will be placed
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Prepare Sonar scanner
run: |
wget -nv https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.7.0.2747-linux.zip
unzip -q sonar-scanner-cli-4.7.0.2747-linux.zip
echo "${PWD}/sonar-scanner-4.7.0.2747-linux/bin/" >> $GITHUB_PATH
wget -nv https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
unzip -q build-wrapper-linux-x86.zip
echo "${PWD}/build-wrapper-linux-x86" >> $GITHUB_PATH
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install -yq gcovr ggcov lcov curl
- name: Configure Compiler
run: |
if [ "${{ matrix.compiler }}" = "gcc" ]; then
echo "CC=gcc-${{ matrix.version }}" >> $GITHUB_ENV
echo "CXX=g++-${{ matrix.version }}" >> $GITHUB_ENV
else
echo "CC=clang-${{ matrix.version }}" >> $GITHUB_ENV
echo "CXX=clang++-${{ matrix.version }}" >> $GITHUB_ENV
fi
- name: Configure Build
run: mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_COVERAGE=ON -DBUILD_SONARCLOUD=ON ..
- name: Build
run: cd build && build-wrapper-linux-x86-64 --out-dir ../bw-output make all
- name: Run Unit Test
run: |
cd build
lcov --gcov-tool /usr/bin/gcov -c -i -d Tests/UnitTests -o base.info
bin/UnitTests
lcov --gcov-tool /usr/bin/gcov -c -d Tests/UnitTests -o test.info
lcov --gcov-tool /usr/bin/gcov -a base.info -a test.info -o coverage.info
lcov --gcov-tool /usr/bin/gcov -r coverage.info '*/Extensions/*' -o coverage.info
lcov --gcov-tool /usr/bin/gcov -r coverage.info '*/Includes/*' -o coverage.info
lcov --gcov-tool /usr/bin/gcov -r coverage.info '*/Libraries/*' -o coverage.info
lcov --gcov-tool /usr/bin/gcov -l coverage.info
- name: SonarCloud Scan
run: sonar-scanner -Dsonar.host.url=https://sonarcloud.io -Dsonar.organization=utilforever-github -Dsonar.login=$SONAR_TOKEN
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
submodules: true
- name: Install sonar-scanner and build-wrapper
uses: SonarSource/sonarcloud-github-c-cpp@v2
- name: Configure Build
run: mkdir build && cd build && cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_SONARCLOUD=ON ..
- name: Run build-wrapper
run: |
cd build && build-wrapper-linux-x86-64 --out-dir ../${{ env.BUILD_WRAPPER_OUT_DIR }} make all
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner --define sonar.cfamily.compile-commands="${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json"
20 changes: 10 additions & 10 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,36 +11,36 @@ jobs:
strategy:
matrix:
include:
# Ubuntu 22.04 + gcc-12
# Ubuntu 22.04 + gcc-13
- name: "Ubuntu 22.04 + gcc-12"
os: ubuntu-22.04
compiler: gcc
version: "12"
# Ubuntu 22.04 + gcc-11
# Ubuntu 22.04 + gcc-12
- name: "Ubuntu 22.04 + gcc-11"
os: ubuntu-22.04
compiler: gcc
version: "11"
# Ubuntu 22.04 + gcc-10
# Ubuntu 22.04 + gcc-11
- name: "Ubuntu 22.04 + gcc-10"
os: ubuntu-22.04
compiler: gcc
version: "10"
# Ubuntu 22.04 + clang-15
- name: "Ubuntu 22.04 + clang-15"
os: ubuntu-22.04
compiler: clang
version: "15"
# Ubuntu 22.04 + clang-14
- name: "Ubuntu 22.04 + clang-14"
os: ubuntu-22.04
compiler: clang
version: "14"
# Ubuntu 22.04 + clang-14
# Ubuntu 22.04 + clang-13
- name: "Ubuntu 22.04 + clang-13"
os: ubuntu-22.04
compiler: clang
version: "13"
# Ubuntu 22.04 + clang-12
- name: "Ubuntu 22.04 + clang-12"
os: ubuntu-22.04
compiler: clang
version: "12"

runs-on: ${{ matrix.os }}
name: 🐧 Build - ${{ matrix.name }}
Expand Down Expand Up @@ -70,4 +70,4 @@ jobs:
run: |
pip3 install -r requirements.txt
pip3 install .
python3 -m pytest Tests/PythonTests/
python3 -m pytest Tests/PythonTests/
6 changes: 3 additions & 3 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ jobs:
run: /a/RosettaStone/RosettaStone/build/bin/Release/UnitTests.exe
- name: Run Python Test
run: |
pip install -r requirements.txt
pip install .
python -m pytest Tests/PythonTests/
pip install -r requirements.txt --break-system-packages
pip install . --break-system-packages
python -m pytest Tests/PythonTests/
8 changes: 4 additions & 4 deletions Sources/Rosetta/PlayMode/CardSets/RevendrethCardsGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,7 @@ void RevendrethCardsGen::AddHunterNonCollect(
// --------------------------------------------------------
// Text: <b>Infused</b>
// <b>Battlecry:</b> Summon 2 Gargon Companions.
// <b>Infuse (4):</b> Summon all 3!   
// <b>Infuse (4):</b> Summon all 3!
// --------------------------------------------------------
// Entourage: REV_353t3, REV_353t4, REV_353t5
// --------------------------------------------------------
Expand Down Expand Up @@ -1173,7 +1173,7 @@ void RevendrethCardsGen::AddPaladin(std::map<std::string, CardDef>& cards)
// - Set: REVENDRETH, Rarity: Rare
// --------------------------------------------------------
// Text: <b>Battlecry:</b> If your deck has no Neutral cards,
// set a minion's stats to 1/1.
// set a minion's stats to 1/1.
// --------------------------------------------------------
// GameTag:
// - BATTLECRY = 1
Expand Down Expand Up @@ -1566,7 +1566,7 @@ void RevendrethCardsGen::AddRogue(std::map<std::string, CardDef>& cards)
// - Set: REVENDRETH, Rarity: Common
// --------------------------------------------------------
// Text: <b>Battlecry:</b> Cast a <b>Secret</b> from your deck.
//  <b>Combo:</b> Cast 2 instead.
// <b>Combo:</b> Cast 2 instead.
// --------------------------------------------------------
// GameTag:
// - BATTLECRY = 1
Expand Down Expand Up @@ -3051,7 +3051,7 @@ void RevendrethCardsGen::AddNeutral(std::map<std::string, CardDef>& cards)
// --------------------------------------------------------
// Text: <b>Rush</b>
// <b>Deathrattle:</b> Summon an 8/8 Gravewing
// with <b>Rush</b>. 
// with <b>Rush</b>.
// --------------------------------------------------------
// GameTag:
// - DEATHRATTLE = 1
Expand Down
22 changes: 6 additions & 16 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,24 +1,14 @@
sonar.projectKey=RosettaStone
sonar.organization=utilforever-github

# This is the name and version displayed in the SonarCloud UI.
sonar.projectName=RosettaStone
sonar.projectVersion=0.4

# =====================================================
# Meta-data for the project
# =====================================================

sonar.links.homepage=https://github.com/utilForever/RosettaStone
sonar.links.ci=https://travis-ci.org/utilForever/RosettaStone
sonar.links.scm=https://github.com/utilForever/RosettaStone
sonar.links.issue=https://github.com/utilForever/RosettaStone/issues

# =====================================================
# Properties that will be shared amongst all modules
# =====================================================

# SQ standard properties
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
sonar.sources=.
sonar.exclusions=README.md,3RD-PARTY.md,Dockerfile,setup.py,Datas/**,Documents/**,Libraries/**,Resources/**,Scripts/**

# Properties specific to the C/C++ analyzer:
sonar.cfamily.build-wrapper-output=bw-output
sonar.cfamily.gcov.reportsPath=build/Tests/UnitTests/CMakeFiles
# Encoding of the source code. Default is default system encoding
sonar.sourceEncoding=UTF-8

0 comments on commit 1fad377

Please sign in to comment.