another attempt at docker on mac runners #16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| jobs: | |
| linux: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cache Conan | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.conan2 | |
| key: conan-${{ runner.os }}-${{ hashFiles('**/conanfile.py') }} | |
| restore-keys: | | |
| conan-${{ runner.os }}- | |
| - name: Install Conan | |
| run: | | |
| pip install conan | |
| - name: Configure Conan for C++20 | |
| run: | | |
| conan profile detect --force | |
| # Override to C++20 (not gnu20 to match CMAKE_CXX_EXTENSIONS=OFF) | |
| sed -i 's/compiler\.cppstd=.*/compiler.cppstd=20/' ~/.conan2/profiles/default || true | |
| echo "compiler.cppstd=20" >> ~/.conan2/profiles/default || true | |
| - name: Build project | |
| run: | | |
| chmod +x scripts/build.sh scripts/test.sh scripts/start-influxdb.sh scripts/stop-influxdb.sh | |
| ./scripts/build.sh Release | |
| - name: Start InfluxDB | |
| run: | | |
| ./scripts/start-influxdb.sh | |
| - name: Run tests | |
| run: | | |
| ./scripts/test.sh | |
| - name: Stop InfluxDB | |
| if: always() | |
| run: | | |
| ./scripts/stop-influxdb.sh | |
| macos: | |
| runs-on: macos-latest | |
| # Note: Docker does not work on Apple Silicon (macos-latest) due to lack of nested virtualization. | |
| # If Docker is needed, consider using macos-13 (Intel) or Linux runners. | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cache Conan | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.conan2 | |
| key: conan-${{ runner.os }}-${{ hashFiles('**/conanfile.py') }} | |
| restore-keys: | | |
| conan-${{ runner.os }}- | |
| - name: Install Conan | |
| run: | | |
| pip install conan | |
| - name: Configure Conan for C++20 | |
| run: | | |
| conan profile detect --force | |
| # Override to C++20 (not gnu20 to match CMAKE_CXX_EXTENSIONS=OFF) | |
| sed -i '' 's/compiler\.cppstd=.*/compiler.cppstd=20/' ~/.conan2/profiles/default || true | |
| echo "compiler.cppstd=20" >> ~/.conan2/profiles/default || true | |
| - name: Build project | |
| run: | | |
| chmod +x scripts/build.sh scripts/test.sh scripts/start-influxdb.sh scripts/stop-influxdb.sh | |
| ./scripts/build.sh Release | |
| - name: Set up Docker on macOS | |
| id: docker-setup | |
| continue-on-error: true | |
| uses: douglascamata/setup-docker-macos-action@v1 | |
| - name: Start InfluxDB | |
| if: steps.docker-setup.outcome == 'success' | |
| run: | | |
| ./scripts/start-influxdb.sh | |
| - name: Run tests | |
| if: steps.docker-setup.outcome == 'success' | |
| run: | | |
| ./scripts/test.sh | |
| - name: Skip integration tests (Docker unavailable) | |
| if: steps.docker-setup.outcome != 'success' | |
| run: | | |
| echo "⚠️ Docker unavailable on macOS runner - skipping integration tests" | |
| echo "Build completed successfully, but integration tests were skipped." | |
| echo "This is a known limitation of Docker on macOS GitHub Actions runners (Apple Silicon)." | |
| - name: Stop InfluxDB | |
| if: always() && steps.docker-setup.outcome == 'success' | |
| run: | | |
| ./scripts/stop-influxdb.sh || true | |
| windows: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cache Conan | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.conan2 | |
| key: conan-${{ runner.os }}-${{ hashFiles('**/conanfile.py') }} | |
| restore-keys: | | |
| conan-${{ runner.os }}- | |
| - name: Cache InfluxDB | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| influxdb-1.8.10-1 | |
| influxdb-1.8.10_windows_amd64.zip | |
| key: influxdb-1.8.10-windows-${{ runner.os }} | |
| restore-keys: | | |
| influxdb-1.8.10-windows- | |
| - name: Install Conan | |
| run: | | |
| pip install conan | |
| - name: Configure Conan for C++20 | |
| shell: bash | |
| run: | | |
| conan profile detect --force | |
| # Override to C++20 for MSVC (uses simple "20" not "gnu20") | |
| sed -i 's/compiler\.cppstd=.*/compiler.cppstd=20/' ~/.conan2/profiles/default || true | |
| echo "compiler.cppstd=20" >> ~/.conan2/profiles/default || true | |
| - name: Build project | |
| run: | | |
| scripts\build.bat Release | |
| - name: Start InfluxDB | |
| run: | | |
| scripts\start-influxdb.bat | |
| - name: Run tests | |
| run: | | |
| scripts\test.bat | |
| - name: Stop InfluxDB | |
| if: always() | |
| run: | | |
| scripts\stop-influxdb.bat |