diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f72ea674..8d1e9ba3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,8 +1,57 @@ -- name: Setup Cpp - uses: aminya/setup-cpp@v1 - with: - compiler: llvm - vcvarsall: true - cmake: true - ninja: true - vcpkg: true +name: ci +on: + pull_request: + push: + branches: + - main + - master + +jobs: + Test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - windows-2022 + - ubuntu-24.04 + - macos-14 # arm64 + - macos-13 + compiler: + - llvm + - gcc + # you can specify the version after `-` like `llvm-18`. + include: + - os: "windows-2022" + compiler: "msvc" + steps: + - uses: actions/checkout@v3 + - name: Cache + uses: actions/cache@v3 + with: + path: | + ./build/ + ~/vcpkg + ~/.cache/vcpkg/archives + ${{ env.LOCALAPPDATA }}/vcpkg/archives + ${{ env.APPDATA }}/vcpkg/archives + ${{ env.XDG_CACHE_HOME }}/vcpkg/archives + ~/.cache/ccache + ~/.ccache + ~/.config/ccache + ~/Library/Caches/ccache + ${{ env.LOCALAPPDATA }}/ccache + ${{ env.XDG_CACHE_HOME }}/ccache + key: ${{ runner.os }}-${{ matrix.compiler }}-${{ env.BUILD_TYPE }}-${{ hashFiles('**/CMakeLists.txt', './vcpkg.json') }} + restore-keys: | + ${{ runner.os }}-${{ env.BUILD_TYPE }}- + + - name: Setup Cpp + uses: aminya/setup-cpp@v1 + with: + compiler: ${{ matrix.compiler }} + vcvarsall: true + cmake: true + ninja: true + vcpkg: true + cppcheck: true # instead of `true`, which chooses the default version, you can pass a specific version.