diff options
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/linux.yml | 82 | ||||
-rw-r--r-- | .github/workflows/macos.yml | 9 |
2 files changed, 79 insertions, 12 deletions
diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 71cd06e..9062d98 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -22,23 +22,36 @@ jobs: curl -L -O https://www.mirrorservice.org/sites/dl.fedoraproject.org/pub/epel/7/x86_64/Packages/p/p7zip-plugins-16.02-10.el7.x86_64.rpm rpm -U --quiet p7zip-16.02-10.el7.x86_64.rpm rpm -U --quiet p7zip-plugins-16.02-10.el7.x86_64.rpm - yum install -y make gcc-c++ + yum install -y make gcc-c++ libasan clang-analyzer - - name: Build ninja + - name: Build debug ninja + shell: bash + env: + CFLAGS: -fstack-protector-all -fsanitize=address + CXXFLAGS: -fstack-protector-all -fsanitize=address + run: | + scan-build -o scanlogs cmake -DCMAKE_BUILD_TYPE=Debug -B debug-build + scan-build -o scanlogs cmake --build debug-build --parallel --config Debug + + - name: Test debug ninja + run: ./ninja_test + working-directory: debug-build + + - name: Build release ninja shell: bash run: | - cmake -DCMAKE_BUILD_TYPE=Release -B build - cmake --build build --parallel --config Release - strip build/ninja + cmake -DCMAKE_BUILD_TYPE=Release -B release-build + cmake --build release-build --parallel --config Release + strip release-build/ninja - - name: Test ninja + - name: Test release ninja run: ./ninja_test - working-directory: build + working-directory: release-build - name: Create ninja archive run: | mkdir artifact - 7z a artifact/ninja-linux.zip ./build/ninja + 7z a artifact/ninja-linux.zip ./release-build/ninja # Upload ninja binary archive as an artifact - name: Upload artifact @@ -57,3 +70,56 @@ jobs: asset_path: ./artifact/ninja-linux.zip asset_name: ninja-linux.zip asset_content_type: application/zip + + test: + runs-on: [ubuntu-latest] + container: + image: ubuntu:20.04 + steps: + - uses: actions/checkout@v2 + - name: Install dependencies + run: | + apt update + apt install -y python3-pytest ninja-build clang-tidy python3-pip clang + pip3 install cmake==3.17.* + - name: Configure (GCC) + run: cmake -Bbuild-gcc -DCMAKE_BUILD_TYPE=Debug -G'Ninja Multi-Config' + + - name: Build (GCC, Debug) + run: cmake --build build-gcc --config Debug + - name: Unit tests (GCC, Debug) + run: ./build-gcc/Debug/ninja_test + - name: Python tests (GCC, Debug) + run: pytest-3 --color=yes ../.. + working-directory: build-gcc/Debug + + - name: Build (GCC, Release) + run: cmake --build build-gcc --config Release + - name: Unit tests (GCC, Release) + run: ./build-gcc/Release/ninja_test + - name: Python tests (GCC, Release) + run: pytest-3 --color=yes ../.. + working-directory: build-gcc/Release + + - name: Configure (Clang) + run: CC=clang CXX=clang++ cmake -Bbuild-clang -DCMAKE_BUILD_TYPE=Debug -G'Ninja Multi-Config' -DCMAKE_EXPORT_COMPILE_COMMANDS=1 + + - name: Build (Clang, Debug) + run: cmake --build build-clang --config Debug + - name: Unit tests (Clang, Debug) + run: ./build-clang/Debug/ninja_test + - name: Python tests (Clang, Debug) + run: pytest-3 --color=yes ../.. + working-directory: build-clang/Debug + + - name: Build (Clang, Release) + run: cmake --build build-clang --config Release + - name: Unit tests (Clang, Release) + run: ./build-clang/Release/ninja_test + - name: Python tests (Clang, Release) + run: pytest-3 --color=yes ../.. + working-directory: build-clang/Release + + - name: clang-tidy + run: /usr/lib/llvm-10/share/clang/run-clang-tidy.py -header-filter=src + working-directory: build-clang diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 411cfe1..4ea958f 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -8,7 +8,7 @@ on: jobs: build: - runs-on: macOS-latest + runs-on: macos-11.0 steps: - uses: actions/checkout@v2 @@ -21,8 +21,9 @@ jobs: env: MACOSX_DEPLOYMENT_TARGET: 10.12 run: | - cmake -DCMAKE_BUILD_TYPE=Release -B build - cmake --build build --parallel --config Release + sudo xcode-select -s /Applications/Xcode_12.2.app + cmake -Bbuild -GXcode '-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64' + cmake --build build --config Release - name: Test ninja run: ctest -vv @@ -32,7 +33,7 @@ jobs: shell: bash run: | mkdir artifact - 7z a artifact/ninja-mac.zip ./build/ninja + 7z a artifact/ninja-mac.zip ./build/Release/ninja # Upload ninja binary archive as an artifact - name: Upload artifact |