1bf215546Sopenharmony_ciname: macOS-CI
2bf215546Sopenharmony_cion: push
3bf215546Sopenharmony_ci
4bf215546Sopenharmony_cipermissions:
5bf215546Sopenharmony_ci  contents: read
6bf215546Sopenharmony_ci
7bf215546Sopenharmony_cijobs:
8bf215546Sopenharmony_ci  macOS-CI:
9bf215546Sopenharmony_ci    strategy:
10bf215546Sopenharmony_ci      matrix:
11bf215546Sopenharmony_ci        glx_option: ['dri', 'xlib']
12bf215546Sopenharmony_ci    runs-on: macos-11
13bf215546Sopenharmony_ci    env:
14bf215546Sopenharmony_ci      GALLIUM_DUMP_CPU: true
15bf215546Sopenharmony_ci      MESON_EXEC: /Users/runner/Library/Python/3.11/bin/meson
16bf215546Sopenharmony_ci    steps:
17bf215546Sopenharmony_ci    - name: Checkout
18bf215546Sopenharmony_ci      uses: actions/checkout@v3
19bf215546Sopenharmony_ci    - name: Install Dependencies
20bf215546Sopenharmony_ci      run: |
21bf215546Sopenharmony_ci        cat > Brewfile <<EOL
22bf215546Sopenharmony_ci        brew "bison"
23bf215546Sopenharmony_ci        brew "expat"
24bf215546Sopenharmony_ci        brew "gettext"
25bf215546Sopenharmony_ci        brew "libx11"
26bf215546Sopenharmony_ci        brew "libxcb"
27bf215546Sopenharmony_ci        brew "libxdamage"
28bf215546Sopenharmony_ci        brew "libxext"
29bf215546Sopenharmony_ci        brew "ninja"
30bf215546Sopenharmony_ci        brew "pkg-config"
31bf215546Sopenharmony_ci        brew "python@3.10"
32bf215546Sopenharmony_ci        EOL
33bf215546Sopenharmony_ci
34bf215546Sopenharmony_ci        brew update
35bf215546Sopenharmony_ci        brew bundle --verbose
36bf215546Sopenharmony_ci    - name: Install Mako and meson
37bf215546Sopenharmony_ci      run: pip3 install --user mako meson
38bf215546Sopenharmony_ci    - name: Configure
39bf215546Sopenharmony_ci      run: |
40bf215546Sopenharmony_ci        cat > native_config <<EOL
41bf215546Sopenharmony_ci        [binaries]
42bf215546Sopenharmony_ci        llvm-config = '/usr/local/opt/llvm/bin/llvm-config'
43bf215546Sopenharmony_ci        EOL
44bf215546Sopenharmony_ci        $MESON_EXEC . build --native-file=native_config -Dbuild-tests=true -Dosmesa=true -Dgallium-drivers=swrast -Dglx=${{ matrix.glx_option }}
45bf215546Sopenharmony_ci    - name: Build
46bf215546Sopenharmony_ci      run: $MESON_EXEC compile -C build
47bf215546Sopenharmony_ci    - name: Test
48bf215546Sopenharmony_ci      run: $MESON_EXEC test -C build --print-errorlogs
49bf215546Sopenharmony_ci    - name: Install
50bf215546Sopenharmony_ci      run: $MESON_EXEC install -C build --destdir $PWD/install
51bf215546Sopenharmony_ci    - name: 'Upload Artifact'
52bf215546Sopenharmony_ci      if: always()
53bf215546Sopenharmony_ci      uses: actions/upload-artifact@v3
54bf215546Sopenharmony_ci      with:
55bf215546Sopenharmony_ci        name: macos-${{ matrix.glx_option }}-result
56bf215546Sopenharmony_ci        path: |
57bf215546Sopenharmony_ci          build/meson-logs/
58bf215546Sopenharmony_ci          install/
59bf215546Sopenharmony_ci        retention-days: 5
60