Fix indentation

This commit is contained in:
Alexander Batalov 2022-07-05 15:18:46 +03:00
parent 5c992f7596
commit 19ac6fde5a
1 changed files with 87 additions and 87 deletions

View File

@ -1,84 +1,84 @@
name: Build name: Build
on: on:
push: push:
paths: paths:
- '.github/workflows/Build.yml' - '.github/workflows/Build.yml'
- 'src/**.cc' - 'src/**.cc'
- 'src/**.h' - 'src/**.h'
- '**/CMakeLists.txt' - '**/CMakeLists.txt'
- '**/*.cmake' - '**/*.cmake'
pull_request: pull_request:
paths: paths:
- '.github/workflows/Build.yml' - '.github/workflows/Build.yml'
- 'src/**.cc' - 'src/**.cc'
- 'src/**.h' - 'src/**.h'
- '**/CMakeLists.txt' - '**/CMakeLists.txt'
- '**/*.cmake' - '**/*.cmake'
defaults: defaults:
run: run:
shell: bash shell: bash
jobs: jobs:
StaticAnalysis: StaticAnalysis:
name: Static analysis name: Static analysis
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Install - name: Install
run: | run: |
: :
echo ::group::apt update echo ::group::apt update
sudo apt update 2>&1 sudo apt update 2>&1
echo ::endgroup:: echo ::endgroup::
sudo apt install cppcheck sudo apt install cppcheck
- name: Clone - name: Clone
uses: actions/checkout@v3 uses: actions/checkout@v3
- name: cppcheck - name: cppcheck
run: cppcheck --std=c++17 src/ run: cppcheck --std=c++17 src/
Build: Build:
name: ${{ matrix.cfg.name }} x${{ matrix.cfg.arch }} name: ${{ matrix.cfg.name }} x${{ matrix.cfg.arch }}
runs-on: ${{ matrix.cfg.os }} runs-on: ${{ matrix.cfg.os }}
needs: [StaticAnalysis] needs: [StaticAnalysis]
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
cfg: cfg:
# #
# name .......... overrides job name in GitHub UI # name .......... overrides job name in GitHub UI
# os ............ defines system image; passed to job.<id>.runs-on # os ............ defines system image; passed to job.<id>.runs-on
# cc ............ defines C compiler; passed to CMake configuration step (as `CC` environment variable) # cc ............ defines C compiler; passed to CMake configuration step (as `CC` environment variable)
# cxx ........... defines C++ compiler; passed to CMake configuration step (as `CXX` environment variable) # cxx ........... defines C++ compiler; passed to CMake configuration step (as `CXX` environment variable)
# ver ........... defines optional suffix to package name when installing compiler with apt, and whenever compiler version is important for build process # ver ........... defines optional suffix to package name when installing compiler with apt, and whenever compiler version is important for build process
# cc: gcc, cxx: g++, ver: null --becomes--> sudo apt install gcc g++ # cc: gcc, cxx: g++, ver: null --becomes--> sudo apt install gcc g++
# cc: gcc, cxx: g++, ver: 10 --becomes--> sudo apt install gcc-10 g++-10 # cc: gcc, cxx: g++, ver: 10 --becomes--> sudo apt install gcc-10 g++-10
# arch .......... defines if building 32bit or 64bit application; used in multiple places to prepare build environment # arch .......... defines if building 32bit or 64bit application; used in multiple places to prepare build environment
# also used as job name suffix (" x32" or " x64") # also used as job name suffix (" x32" or " x64")
# generator ..... passed to CMake configuration step (as `-G` switch) # generator ..... passed to CMake configuration step (as `-G` switch)
# can-fail ...... defines if job status should be set to success even if compilation fails # can-fail ...... defines if job status should be set to success even if compilation fails
# applies *only* to compilation step; errors in any other steps (installation, preparing build directory, etc.) still mark job as failed # applies *only* to compilation step; errors in any other steps (installation, preparing build directory, etc.) still mark job as failed
# artifact ...... path to compiled application; use "NO" if given job run should not generate any artifacts (case sensitive) # artifact ...... path to compiled application; use "NO" if given job run should not generate any artifacts (case sensitive)
# artifact-os ... defines artifact name suffix # artifact-os ... defines artifact name suffix
# #
- { name: Linux GCC, os: ubuntu-20.04, cc: gcc, cxx: g++, ver: null, arch: 32, generator: "Unix Makefiles", can-fail: false, artifact: Build/fallout2-ce, artifact-os: linux } - { name: Linux GCC, os: ubuntu-20.04, cc: gcc, cxx: g++, ver: null, arch: 32, generator: "Unix Makefiles", can-fail: false, artifact: Build/fallout2-ce, artifact-os: linux }
# { name: Linux GCC, os: ubuntu-22.04, cc: gcc, cxx: g++, ver: null, arch: 64, generator: "Unix Makefiles", can-fail: true, artifact: Build/fallout2-ce, artifact-os: linux } # { name: Linux GCC, os: ubuntu-22.04, cc: gcc, cxx: g++, ver: null, arch: 64, generator: "Unix Makefiles", can-fail: true, artifact: Build/fallout2-ce, artifact-os: linux }
- { name: Linux GCC 10, os: ubuntu-22.04, cc: gcc, cxx: g++, ver: 10, arch: 32, generator: "Unix Makefiles", can-fail: false, artifact: NO, artifact-os: linux } - { name: Linux GCC 10, os: ubuntu-22.04, cc: gcc, cxx: g++, ver: 10, arch: 32, generator: "Unix Makefiles", can-fail: false, artifact: NO, artifact-os: linux }
# { name: Linux GCC 10, os: ubuntu-22.04, cc: gcc, cxx: g++, ver: 10, arch: 64, generator: "Unix Makefiles", can-fail: true, artifact: NO, artifact-os: linux } # { name: Linux GCC 10, os: ubuntu-22.04, cc: gcc, cxx: g++, ver: 10, arch: 64, generator: "Unix Makefiles", can-fail: true, artifact: NO, artifact-os: linux }
# { name: MacOS 11 CLang, os: macOS-11, cc: clang, cxx: clang++, ver: null, arch: 64, generator: "Unix Makefiles", can-fail: true, artifact: NO, artifact-os: mac } # { name: MacOS 11 CLang, os: macOS-11, cc: clang, cxx: clang++, ver: null, arch: 64, generator: "Unix Makefiles", can-fail: true, artifact: NO, artifact-os: mac }
# { name: MacOS 12 CLang, os: macOS-12, cc: clang, cxx: clang++, ver: null, arch: 64, generator: "Unix Makefiles", can-fail: true, artifact: NO, artifact-os: mac } # { name: MacOS 12 CLang, os: macOS-12, cc: clang, cxx: clang++, ver: null, arch: 64, generator: "Unix Makefiles", can-fail: true, artifact: NO, artifact-os: mac }
- { name: Windows VS2019, os: windows-2019, cc: cl, cxx: cl, ver: null, arch: 32, generator: "Visual Studio 16 2019", can-fail: false, artifact: NO, artifact-os: windows } - { name: Windows VS2019, os: windows-2019, cc: cl, cxx: cl, ver: null, arch: 32, generator: "Visual Studio 16 2019", can-fail: false, artifact: NO, artifact-os: windows }
# { name: Windows VS2019, os: windows-2019, cc: cl, cxx: cl, ver: null, arch: 64, generator: "Visual Studio 16 2019", can-fail: true, artifact: NO, artifact-os: windows } # { name: Windows VS2019, os: windows-2019, cc: cl, cxx: cl, ver: null, arch: 64, generator: "Visual Studio 16 2019", can-fail: true, artifact: NO, artifact-os: windows }
- { name: Windows VS2022, os: windows-2022, cc: cl, cxx, cl, ver: null, arch: 32, generator: "Visual Studio 17 2022", can-fail: false, artifact: Build/Release/fallout2-ce.exe, artifact-os: windows } - { name: Windows VS2022, os: windows-2022, cc: cl, cxx, cl, ver: null, arch: 32, generator: "Visual Studio 17 2022", can-fail: false, artifact: Build/Release/fallout2-ce.exe, artifact-os: windows }
# { name: Windows VS2022, os: windows-2022, cc: cl, cxx, cl, ver: null, arch: 64, generator: "Visual Studio 17 2022", can-fail: true, artifact: Build/Release/fallout2-ce.exe, artifact-os: windows } # { name: Windows VS2022, os: windows-2022, cc: cl, cxx, cl, ver: null, arch: 64, generator: "Visual Studio 17 2022", can-fail: true, artifact: Build/Release/fallout2-ce.exe, artifact-os: windows }
steps: steps:
- name: Configure - name: Configure
run: | run: |
: Here be dragons : : Here be dragons :
#set -x #set -x
arch=${{ matrix.cfg.arch }} arch=${{ matrix.cfg.arch }}
@ -155,9 +155,9 @@ jobs:
fi fi
fi fi
- name: Install - name: Install
if: env.GHA_PM != '' if: env.GHA_PM != ''
run: | run: |
: :
#set -x #set -x
@ -183,23 +183,23 @@ jobs:
echo :endgroup:: echo :endgroup::
fi fi
- name: Clone - name: Clone
uses: actions/checkout@v3 uses: actions/checkout@v3
# Using ${{ env.NAME }} here (instead of usual $NAME) to make full command line clearly displayed, without need to check step environment first # Using ${{ env.NAME }} here (instead of usual $NAME) to make full command line clearly displayed, without need to check step environment first
- name: Prepare - name: Prepare
run: cmake -B Build -G "${{ matrix.cfg.generator }}" ${{ env.GHA_PLATFORM }} ${{ env.GHA_TOOLCHAIN }} 2>&1 run: cmake -B Build -G "${{ matrix.cfg.generator }}" ${{ env.GHA_PLATFORM }} ${{ env.GHA_TOOLCHAIN }} 2>&1
env: env:
CC: ${{ env.GHA_CC }} CC: ${{ env.GHA_CC }}
CXX: ${{ env.GHA_CXX }} CXX: ${{ env.GHA_CXX }}
- name: Build - name: Build
run: cmake --build Build --config Release && echo BUILD_OK=1 >> $GITHUB_ENV run: cmake --build Build --config Release && echo BUILD_OK=1 >> $GITHUB_ENV
continue-on-error: ${{ matrix.cfg.can-fail }} continue-on-error: ${{ matrix.cfg.can-fail }}
- name: Artifact prepare - name: Artifact prepare
if: matrix.cfg.artifact != 'NO' && env.BUILD_OK == 1 if: matrix.cfg.artifact != 'NO' && env.BUILD_OK == 1
run: | run: |
: :
echo BUILD_OK=0 >> $GITHUB_ENV echo BUILD_OK=0 >> $GITHUB_ENV
dir="${{ matrix.cfg.artifact-os }}/x${{ matrix.cfg.arch }}" dir="${{ matrix.cfg.artifact-os }}/x${{ matrix.cfg.arch }}"
@ -207,13 +207,13 @@ jobs:
cp "${{ matrix.cfg.artifact }}" "$dir" cp "${{ matrix.cfg.artifact }}" "$dir"
echo BUILD_OK=1 >> $GITHUB_ENV echo BUILD_OK=1 >> $GITHUB_ENV
- name: Artifact upload - name: Artifact upload
if: matrix.cfg.artifact != 'NO' && env.BUILD_OK == 1 if: matrix.cfg.artifact != 'NO' && env.BUILD_OK == 1
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: fallout2-ce-${{ matrix.cfg.artifact-os }} name: fallout2-ce-${{ matrix.cfg.artifact-os }}
path: "${{ matrix.cfg.artifact-os }}/x${{ matrix.cfg.arch }}" path: "${{ matrix.cfg.artifact-os }}/x${{ matrix.cfg.arch }}"
retention-days: 7 retention-days: 7
macos: macos:
runs-on: macos-latest runs-on: macos-latest