From 57a052fcbde6c8dac73220cf1ebe4f76dfed2e20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jobert=20S=C3=A1?= Date: Mon, 24 Jun 2024 01:29:45 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20Updated=20workflows?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yml | 35 ++++++++++++++++----------------- .github/workflows/main.yml | 40 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 18 deletions(-) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 03d5fd2..5399b06 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,13 +1,8 @@ -# This workflow will build a Swift project -# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift - name: CI on: - push: - branches: [ "main" ] pull_request: - branches: [ "main" ] + branches: [main] workflow_dispatch: concurrency: @@ -18,15 +13,19 @@ jobs: runs-on: macos-latest timeout-minutes: 30 steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Select Xcode version - run: sudo xcode-select -s /Applications/Xcode_15.4.app - - name: Build and Tests - run: xcodebuild build -scheme HUDHero -sdk iphonesimulator17.5 -destination "OS=17.5,name=iPhone 15 Pro" -resultBundlePath HUDHero.xcresult test - - name: Display test results - uses: jobearrr/xcresulttool@v1 - with: - path: HUDHero.xcresult - token: ${{ secrets.GITHUB_TOKEN }} - if: success() || failure() + - name: Checkout code + uses: actions/checkout@v4 + - name: Select Xcode version + run: sudo xcode-select -s /Applications/Xcode_15.4.app + - name: Build & Tests + run: | + xcodebuild clean build test -scheme HUDHero \ + -sdk iphonesimulator17.5 \ + -destination "OS=17.5,name=iPhone 15 Pro" \ + -resultBundlePath HUDHero.xcresult + - name: Display test results + uses: jobearrr/xcresulttool@v1 + with: + path: HUDHero.xcresult + token: ${{ secrets.GITHUB_TOKEN }} + if: success() || failure() diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..ec6742f --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,40 @@ +name: Main + +on: + push: + branches: [main] + workflow_dispatch: + +concurrency: + group: "Main" + +jobs: + test-and-gather-test-coverage: + runs-on: macos-latest + timeout-minutes: 30 + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Install Slather + run: sudo gem install slather + - name: Select Xcode version + run: sudo xcode-select -s /Applications/Xcode_15.4.app + - name: Build & Tests + run: | + xcodebuild clean build test \ + -scheme HUDHero \ + -sdk iphonesimulator17.5 \ + -destination "OS=17.5,name=iPhone 15 Pro" \ + ONLY_ACTIVE_ARCH=YES \ + -resultBundlePath HUDHero.xcresult + -derivedDataPath /tmp/DerivedDataWithCoverageForiOS \ + - name: Test & publish code coverage + uses: paambaati/codeclimate-action@v3.2.0 + env: + CC_TEST_REPORTER_ID: "${{ secrets.CC_TEST_REPORTER_ID }}" + with: + debug: true + coverageCommand: | + slather coverage -x --scheme "HUDHero" --output-directory "slather_reports/HUDHero_iOS" -b "/tmp/DerivedDataWithCoverageForiOS" + coverageLocations: | + ${{ github.workspace }}/slather_reports/HUDHero_iOS/cobertura.xml:cobertura