ci: 最大200行を守るためのステップを追加 #83
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: Build on macOS | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| types: | |
| - opened | |
| - synchronize | |
| jobs: | |
| build: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: install meson | |
| run: pip install meson | |
| - name: Check file line limits | |
| run: | | |
| for file in $(find src/ -name "*.cpp" -o -name "*.hpp"); do | |
| lines=$(wc -l < "$file") | |
| if [ "$lines" -gt 200 ]; then | |
| echo "ERROR: $file has $lines lines (limit: 200)" | |
| exit 1 | |
| fi | |
| done | |
| - name: Cache vcpkg packages | |
| id: cache-vcpkg | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| vcpkg_installed | |
| vcpkg/buildtrees | |
| vcpkg/packages | |
| vcpkg/vcpkg | |
| key: ${{ runner.os }}-vcpkg-${{ hashFiles('vcpkg.json', 'triplets/**', '.gitmodules') }} | |
| - name: Setup vcpkg | |
| if: steps.cache-vcpkg.outputs.cache-hit != 'true' | |
| run: | | |
| ./vcpkg/bootstrap-vcpkg.sh | |
| ./vcpkg/vcpkg install --overlay-triplets=./triplets --triplet=custom-arm64-osx | |
| - name: Build & install orge (static) | |
| run: | | |
| export CC=clang | |
| export CXX=clang++ | |
| meson setup build-static \ | |
| -Dbuild_examples=true \ | |
| -Dbuildtype=release \ | |
| --prefix=$(pwd)/installed-static \ | |
| --cmake-prefix-path=$(pwd)/vcpkg_installed/custom-arm64-osx \ | |
| --default-library=static | |
| meson install -C build-static | |
| find installed-static -print | |
| - name: Build & install orge (shared) | |
| run: | | |
| export CC=clang | |
| export CXX=clang++ | |
| meson setup build-shared \ | |
| -Dbuild_examples=true \ | |
| -Dbuildtype=release \ | |
| --prefix=$(pwd)/installed-shared \ | |
| --cmake-prefix-path=$(pwd)/vcpkg_installed/custom-arm64-osx \ | |
| --default-library=shared | |
| meson install -C build-shared | |
| find installed-shared -print | |
| - name: Upload orge artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: orge-lib | |
| path: | | |
| ./installed-static | |
| ./installed-shared | |
| ./examples/simple/main.cpp | |
| - name: Prepare uploading orge artifacts (for release) | |
| if: startsWith(github.head_ref, 'release') | |
| run: | | |
| cp -r licenses installed-static | |
| cp -r licenses installed-shared | |
| - name: Upload orge artifacts (for release) (static) | |
| if: startsWith(github.head_ref, 'release') | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: orge-arm64-osx-static | |
| path: installed-static | |
| - name: Upload orge artifacts (for release) (shared) | |
| if: startsWith(github.head_ref, 'release') | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: orge-arm64-osx-shared | |
| path: installed-shared | |
| test-standalone: | |
| runs-on: macos-latest | |
| needs: build | |
| steps: | |
| - name: Download orge artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: orge-lib | |
| path: ./orge | |
| - name: Test build with static | |
| run: | | |
| export PKG_CONFIG_PATH=$(pwd)/orge/installed-static/lib/pkgconfig | |
| mkdir ./static | |
| cd ./static | |
| g++ ../orge/examples/simple/main.cpp $(pkg-config orge --cflags --libs --static) | |
| - name: Test build with shared | |
| run: | | |
| export PKG_CONFIG_PATH=$(pwd)/orge/installed-shared/lib/pkgconfig | |
| mkdir ./shared | |
| cd ./shared | |
| g++ ../orge/examples/simple/main.cpp $(pkg-config orge --cflags --libs) |