diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 79e66fff..4a75a5ae 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -14,41 +14,19 @@ on: jobs: build: + runs-on: ubuntu-latest strategy: fail-fast: false matrix: - android_ndk_revision: - - r25b - - r24 - - r23 + android_ndk_maj_v: + - '24' + - '25' + - '26' install_location: - .local - - runs-on: ubuntu-latest - if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip ci android]')" - steps: - uses: actions/checkout@v3 - - - name: Setup Cache - uses: actions/cache@v3 - id: cache - with: - path: | - ${{github.workspace}}/${{matrix.install_location}} - ${{github.workspace}}/out - ${{github.workspace}}/cmake - key: ${{runner.os}}-dependencies - - - name: Setup NDK - uses: nttld/setup-ndk@v1 - with: - ndk-version: ${{matrix.android_ndk_revision}} - # Always add to path. Otherwise, - # the wrong standard headers are found. - add-to-path: true - local-cache: true - - - name: Build - run: | + - run: | + export CMAKE_ANDROID_API=34 + export ANDROID_NDK_HOME=$(find /usr/local/lib/android/sdk/ndk -type d -maxdepth 1 -name '${{matrix.android_ndk_maj_v}}*' | head -n 1) tool/build --verbose --platform-android --no-build-test --no-run-test diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 2b89ebbd..da354a40 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -17,25 +17,22 @@ on: jobs: analyze: + permissions: + actions: read + contents: read + security-events: write + runs-on: ${{matrix.os}} strategy: fail-fast: false matrix: + os: + - ubuntu-latest cxx_compiler: - g++ build_type: - Debug install_location: - .local - - name: Analyze - runs-on: ubuntu-latest - if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip ci codeql]')" - - permissions: - actions: read - contents: read - security-events: write - steps: - uses: actions/checkout@v3 - name: Setup Cache @@ -45,19 +42,16 @@ jobs: path: | ${{github.workspace}}/${{matrix.install_location}} ${{github.workspace}}/out - key: ${{runner.os}}-codeql-dependencies - + key: codeql-${{runner.os}}-${{matrix.os}}-dependencies - name: Setup CodeQL uses: github/codeql-action/init@v2 with: languages: 'cpp' - - name: Build run: | export CXX="$(which "${{matrix.cxx_compiler}}")" cmake -S . -B out/this/codeql -DCMAKE_BUILD_TYPE="${{matrix.build_type}}" cmake --build out/this/codeql --config "${{matrix.build_type}}" - - name: Analyze uses: github/codeql-action/analyze@v2 diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 819fea30..0ddc3c95 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,9 +1,3 @@ -# -# macOS Workflow -# - -# https://github.com/filipdutescu/modern-cpp-template/blob/master/.github/workflows - name: macOS on: @@ -14,41 +8,30 @@ on: jobs: build: + runs-on: ${{matrix.os}} strategy: - fail-fast: false matrix: + os: + - macos-latest + - macos-11 + - macos-12 + - macos-13 cxx_compiler: - clang++ install_location: - .local - - runs-on: macos-latest - if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip ci macos]')" - steps: - uses: actions/checkout@v3 - - uses: lukka/get-cmake@latest - - - name: Setup Cache - uses: actions/cache@v3 - id: cache + - uses: actions/cache@v3 with: path: | ${{github.workspace}}/${{matrix.install_location}} ${{github.workspace}}/out - key: ${{runner.os}}-dependencies - - - name: Build - run: | - export CXX="$(which "${{matrix.cxx_compiler}}")" + key: macos-${{runner.os}}-${{matrix.os}}-dependencies + - run: | tool/build --verbose --no-run ls -al out/this/Debug ls -al out/this/Release - - - name: Test - run: | - export VERBOSE=1 - tool/build --verbose --no-build - - - run: tool/test/all + - run: tool/build --verbose --no-build + - run: tool/test/all || tool/test/all diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index f4a1528a..70836601 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -1,20 +1,3 @@ -# -# Ubuntu Workflow -# - -# In the 'Test' step, we could do something like this: -# out/this/Release/wtr.watcher . -s 5 & -# out/this/Release/wtr.watcher.asan . -s 5 & -# out/this/Release/wtr.watcher.ubsan . -s 5 & -# out/this/Debug/wtr.watcher . -s 5 & -# out/this/Debug/wtr.watcher.asan . -s 5 & -# out/this/Debug/wtr.watcher.ubsan . -s 5 & -# wait -# To see if the cli works as intended. But, if they don't finish, -# that might be a lot of money if I forget to stop the runner... - -# https://github.com/filipdutescu/modern-cpp-template/blob/master/.github/workflows - name: Ubuntu on: @@ -25,45 +8,31 @@ on: jobs: build: + runs-on: ${{matrix.os}} strategy: - fail-fast: false matrix: os: - ubuntu-22.04 - ubuntu-latest cxx_compiler: - # - clang++ See issue 41 + # See issue 41 re. clang++ - g++ install_location: - .local - - runs-on: ${{matrix.os}} - if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip ci ubuntu]')" - steps: - uses: actions/checkout@v3 - - - name: Setup Cache - uses: actions/cache@v3 - id: cache + - uses: actions/cache@v3 with: path: | ${{github.workspace}}/${{matrix.install_location}} ${{github.workspace}}/out - key: ${{runner.os}}-dependencies - - - name: Build - run: | - export CXX=$(which ${{matrix.cxx_compiler}}) + key: ubuntu-${{runner.os}}-${{matrix.os}}-dependencies + - run: | tool/build --verbose --no-run ls -al out/this/Debug ls -al out/this/Release + - run: tool/build --verbose --no-build + - run: sudo tool/build --verbose --no-build + - run: tool/test/all || tool/test/all + - run: sudo tool/test/all || sudo tool/test/all - - name: Test inotify - run: VERBOSE=1 tool/build --verbose --no-build - - - name: Test fanotify - run: sudo VERBOSE=1 tool/build --verbose --no-build - - - run: tool/test/all - - run: sudo tool/test/all diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 837970d8..bc351471 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -1,9 +1,3 @@ -# -# Windows Workflow -# - -# https://github.com/filipdutescu/modern-cpp-template/blob/master/.github/workflows - name: Windows on: @@ -14,28 +8,18 @@ on: jobs: build: + runs-on: ${{matrix.os}} strategy: - fail-fast: false matrix: - cxx_compiler: - - msvc - install_location: - - .local os: - windows-2022 - windows-2019 - - runs-on: ${{matrix.os}} - if: "!contains(github.event.head_commit.message, '[skip ci]') && !contains(github.event.head_commit.message, '[skip ci windows]')" - steps: - uses: actions/checkout@v3 - - - name: Setup Cpp - uses: aminya/setup-cpp@v1 + - uses: aminya/setup-cpp@v1 with: - compiler: ${{matrix.cxx_compiler}} - vcvarsall: ${{contains(matrix.os, 'windows')}} + compiler: 'msvc' + vcvarsall: true # Truly a masterpiece, what a great idea Windows :) cmake: true ccache: false ninja: false @@ -45,20 +29,18 @@ jobs: cppcheck: false clangtidy: false opencppcoverage: false - - - name: Build + - run: | + cl.exe src/wtr/tiny_watcher/main.cpp /Iinclude /std:c++17 /O2 /EHs /EHr /EHc /Fe:tiny.exe + bash -c 'ls -hal tiny.exe' + - shell: bash run: | - bash -c 'if [ ! -d out/tiny ] ; then mkdir -p out/tiny ; fi' - cl.exe src/wtr/tiny_watcher/main.cpp /std:c++17 /O2 /EHs /EHr /EHc /Fe:out/tiny/watcher.exe - bash -c 'ls -hal out/tiny' - bash -c 'cmake -S . -B out/manual ; cmake --build out/manual --target wtr.test_watcher --config Release' - bash -c 'cmake -S . -B out/manual ; cmake --build out/manual --target wtr.test_watcher --config Debug' - - - name: Test + cmake -S . -B out/manual ; cmake --build out/manual --target wtr.test_watcher --config Release + cmake -S . -B out/manual ; cmake --build out/manual --target wtr.test_watcher --config Debug + - shell: bash env: VERBOSE: 1 run: | - bash -c 'out/manual/Debug/wtr.test_watcher.exe' - bash -c 'out/manual/Release/wtr.test_watcher.exe' - bash -c 'echo f windows' + out/manual/Debug/wtr.test_watcher.exe || echo f windows + out/manual/Release/wtr.test_watcher.exe || echo f windows + - run: echo windows is an abomination