diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index b8d7db10..2907cfb3 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -4,26 +4,23 @@ on: pull_request: branches: - main - paths: - - '.github/workflows/build_and_test.yml' - - 'Sources/**' - - '!Sources/Runestone/Documentation.docc/**' - - 'Tests/**' concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: build: - name: Build and test + name: Build and Test (Xcode ${{ matrix.xcode }}) runs-on: macos-14 continue-on-error: true strategy: matrix: include: - - destination: iPhone 15 Pro - xcode: 15.2 - - destination: iPhone 14 Pro - xcode: 14.3.1 + - xcode: 15.2 + destination: iPhone 15 Pro + os: 17.2 + - xcode: 14.3.1 + destination: iPhone 14 Pro + os: 16.4 env: DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer steps: @@ -31,15 +28,31 @@ jobs: uses: actions/checkout@v4 with: submodules: recursive + - name: Check for changed files + uses: dorny/paths-filter@v3 + id: changes + with: + filters: | + src: + - '.github/workflows/build_and_test.yml' + - 'Sources/**' + - '!Sources/Runestone/Documentation.docc/**' + - 'Tests/**' - name: Build + if: steps.changes.outputs.src == 'true' run: | + set -o pipefail\ xcodebuild build-for-testing\ -scheme Runestone\ -sdk iphonesimulator\ - -destination "platform=iOS Simulator,name=${{ matrix.destination }},OS=latest" + -destination "platform=iOS Simulator,name=${{ matrix.destination }},OS=${{ matrix.os }}"\ + | xcbeautify --renderer github-actions - name: Test + if: steps.changes.outputs.src == 'true' run: | + set -o pipefail\ xcodebuild test-without-building\ -scheme Runestone\ -sdk iphonesimulator\ - -destination "platform=iOS Simulator,name=${{ matrix.destination }},OS=latest" + -destination "platform=iOS Simulator,name=${{ matrix.destination }},OS=${{ matrix.os }}"\ + | xcbeautify --renderer github-actions diff --git a/.github/workflows/build_example_project.yml b/.github/workflows/build_example_project.yml index 25b03cc5..c74e9056 100644 --- a/.github/workflows/build_example_project.yml +++ b/.github/workflows/build_example_project.yml @@ -4,27 +4,23 @@ on: pull_request: branches: - main - paths: - - '.github/workflows/build_example_project.yml' - - 'Example/**' - - 'Sources/**' concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: build: - name: Build example project + name: Build Example Project (Xcode ${{ matrix.xcode }}) runs-on: macos-14 continue-on-error: true strategy: matrix: include: - - platform: iOS Simulator + - xcode: 15.2 destination: iPhone 15 Pro - xcode: 15.2 - - platform: iOS Simulator + os: 17.2 + - xcode: 14.3.1 destination: iPhone 14 Pro - xcode: 14.3.1 + os: 16.4 env: DEVELOPER_DIR: /Applications/Xcode_${{ matrix.xcode }}.app/Contents/Developer steps: @@ -32,10 +28,22 @@ jobs: uses: actions/checkout@v4 with: submodules: recursive + - name: Check for changed files + uses: dorny/paths-filter@v3 + id: changes + with: + filters: | + src: + - '.github/workflows/build_example_project.yml' + - 'Example/**' + - 'Sources/**' - name: Build + if: steps.changes.outputs.src == 'true' run: | + set -o pipefail\ xcodebuild build\ -project Example/Example.xcodeproj\ -scheme Example\ -sdk iphonesimulator\ - -destination "platform=${{ matrix.platform }},name=${{ matrix.destination }},OS=latest" + -destination "platform=iOS Simulator,name=${{ matrix.destination }},OS=${{ matrix.os }}"\ + | xcbeautify --renderer github-actions diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index db234f9d..c5a0e6fb 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -10,7 +10,8 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true env: - DEVELOPER_DIR: /Applications/Xcode_15.0.1.app/Contents/Developer + XCODEBUILD_DESTINATION: iPhone 15 Pro + XCODEBUILD_OS: 17.2 jobs: analyze: name: Analyze @@ -22,21 +23,36 @@ jobs: matrix: language: [ "swift", "c-cpp" ] steps: - - name: Checkout repository + - name: Checkout uses: actions/checkout@v4 with: submodules: recursive + - name: Check for changed files + uses: dorny/paths-filter@v3 + id: changes + with: + filters: | + src: + - 'Example/**' + - 'Sources/**' + - 'Tests/**' + - 'UITests/**' - name: Initialize CodeQL + if: steps.changes.outputs.src == 'true' uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} - name: Build + if: steps.changes.outputs.src == 'true' run: | + set -o pipefail\ xcodebuild\ -scheme Runestone\ -sdk iphonesimulator\ - -destination "platform=iOS Simulator,name=iPhone 15 Pro,OS=latest" + -destination "platform=iOS Simulator,name=${{ env.XCODEBUILD_DESTINATION }},OS=${{ env.XCODEBUILD_OS }}"\ + | xcbeautify --renderer github-actions - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@v3 + if: steps.changes.outputs.src == 'true' with: category: "/language:${{matrix.language}}" diff --git a/.github/workflows/deploy_documentation.yml b/.github/workflows/deploy_documentation.yml index db45fc36..693d6d3c 100644 --- a/.github/workflows/deploy_documentation.yml +++ b/.github/workflows/deploy_documentation.yml @@ -1,6 +1,6 @@ name: Deploy Documentation on: - workflow_dispatch: + workflow_dispatch: {} permissions: contents: read pages: write @@ -8,8 +8,6 @@ permissions: concurrency: group: "pages" cancel-in-progress: true -env: - DEVELOPER_DIR: /Applications/Xcode_15.2.app/Contents/Developer jobs: build: runs-on: macos-14 diff --git a/.github/workflows/swiftlint.yml b/.github/workflows/swiftlint.yml index f91fbbe4..16c0febe 100644 --- a/.github/workflows/swiftlint.yml +++ b/.github/workflows/swiftlint.yml @@ -1,11 +1,7 @@ name: SwiftLint on: workflow_dispatch: {} - pull_request: - paths: - - '.github/workflows/swiftlint.yml' - - '.swiftlint.yml' - - '**/*.swift' + pull_request: {} concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true