Skip to content

Commit

Permalink
ci: simplify, remove most deps
Browse files Browse the repository at this point in the history
  • Loading branch information
Will committed Nov 24, 2023
1 parent d741862 commit 8563c07
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 144 deletions.
38 changes: 8 additions & 30 deletions .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
22 changes: 8 additions & 14 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

39 changes: 11 additions & 28 deletions .github/workflows/macos.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
#
# macOS Workflow
#

# https://github.com/filipdutescu/modern-cpp-template/blob/master/.github/workflows

name: macOS

on:
Expand All @@ -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
49 changes: 9 additions & 40 deletions .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
46 changes: 14 additions & 32 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
#
# Windows Workflow
#

# https://github.com/filipdutescu/modern-cpp-template/blob/master/.github/workflows

name: Windows

on:
Expand All @@ -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
Expand All @@ -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

0 comments on commit 8563c07

Please sign in to comment.