| name: CI |
| |
| # Controls when the action will run. |
| on: |
| # Triggers the workflow on push or pull request events |
| push: |
| pull_request: |
| # Allows you to run this workflow manually from the Actions tab |
| workflow_dispatch: |
| |
| # A workflow run is made up of one or more jobs that can run sequentially or in parallel |
| # See the following, which includes links to supported macOS versions, including supported Xcode versions |
| # https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources |
| jobs: |
| build: |
| strategy: |
| matrix: |
| xcode: [ "13.2.1" ] |
| platform: [ "macos", "maccat", "ios", "tvos" ] |
| os: [ "macos-latest" ] |
| upload_artifacts: [ true ] |
| # additional specific configurations |
| include: |
| # "Legacy" Xcode 11.7 & 12.5.1 macOS builds |
| - xcode: "11.7" |
| platform: "macos" |
| os: "macos-10.15" |
| upload_artifacts: false |
| - xcode: "12.5.1" |
| platform: "macos" |
| os: "macos-11" |
| upload_artifacts: false |
| fail-fast: false |
| |
| name: 'MoltenVK (Xcode ${{ matrix.xcode }} - ${{ matrix.platform }})' |
| |
| runs-on: ${{ matrix.os }} |
| |
| env: |
| XCODE_DEV_PATH: "/Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer" |
| |
| steps: |
| # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
| - uses: actions/checkout@v2 |
| |
| - name: Select Xcode version |
| run: sudo xcode-select -switch "${XCODE_DEV_PATH}" |
| |
| - name: Prep |
| id: prep |
| run: | |
| echo "Get Xcode version info" |
| XCODE_VERSION="$(xcodebuild -version)" |
| echo "${XCODE_VERSION}" |
| XCODE_VERSION="$(echo "${XCODE_VERSION}" | tr '\t\r\n ' '_')" |
| echo "${XCODE_VERSION}" |
| echo "::set-output name=XCODE_VERSION::${XCODE_VERSION}" |
| |
| - name: Cache Dependencies |
| id: cache-dependencies |
| if: success() && !(github.event_name == 'push' && contains(github.ref, 'refs/tags/')) # never cache dependencies for pushed tags |
| uses: actions/cache@v2 |
| with: |
| path: | |
| External/build |
| !External/build/Intermediates |
| key: ${{ runner.os }}-${{ steps.prep.outputs.XCODE_VERSION }}-${{ matrix.platform }}-${{ hashFiles('fetchDependencies','ExternalRevisions/**','ExternalDependencies.xcodeproj/**','Scripts/**') }} |
| |
| - name: Fetch Dependencies (Use Built Cache) |
| if: steps.cache-dependencies.outputs.cache-hit == 'true' |
| run: | |
| ./fetchDependencies -v --none |
| |
| - name: Fetch Dependencies |
| if: steps.cache-dependencies.outputs.cache-hit != 'true' |
| run: | |
| ./fetchDependencies -v --${{ matrix.platform }} |
| |
| - name: Output Dependency Build Logs on Failure |
| if: failure() |
| run: cat "dependenciesbuild.log" |
| |
| - name: Build MoltenVK |
| run: | |
| make ${{ matrix.platform }} |
| |
| - name: Output MoltenVK Build Logs on Failure |
| if: failure() |
| run: | |
| if [ -f "xcodebuild.log" ]; then |
| cat "xcodebuild.log" |
| fi |
| |
| - name: Tar Artifacts |
| if: success() && matrix.upload_artifacts == true |
| # See: https://github.com/actions/upload-artifact#maintaining-file-permissions-and-case-sensitive-files |
| run: tar -cvf "${{ matrix.platform }}.tar" Package/Release/ |
| |
| - name: Upload Artifacts |
| if: success() && matrix.upload_artifacts == true |
| uses: actions/upload-artifact@v2 |
| with: |
| name: ${{ matrix.platform }} |
| path: "${{ matrix.platform }}.tar" |