Skip to content

Only report coverage from non-macOS spec runs #1257

Only report coverage from non-macOS spec runs

Only report coverage from non-macOS spec runs #1257

Workflow file for this run

name: Specs
jobs:
specs:
strategy:
fail-fast: false
matrix:
task: [SPECS]
ruby: [2.6, 2.7]
os: [ubuntu-20.04]
coverage: [0]
include:
- task: SPECS
os: macos-latest
ruby: system
- task: SPECS
os: ubuntu-20.04
ruby: 3.0
coverage: 1
- task: EXAMPLES
os: macos-14
ruby: system
name: ${{ matrix.task }} / ${{ matrix.os }} / Ruby ${{ matrix.ruby }}
runs-on: ${{ matrix.os }}
steps:
- name: Set build image var
run: echo "ImageVersion=$ImageVersion" >> $GITHUB_ENV
- name: Checkout git
uses: actions/checkout@v1
- name: Set up Ruby
uses: ruby/setup-ruby@v1
if: ${{ matrix.ruby != 'system' }}
with:
ruby-version: ${{ matrix.ruby }}
- name: Update git submodules
run: git submodule update --init
- uses: actions/cache/restore@v4
id: bundle-cache-restore
with:
path: vendor/bundle
key: gems@v1-${{ matrix.os }}-${{ env.ImageVersion }}-Ruby${{ matrix.ruby }}-${{ hashFiles('Gemfile.lock') }}
restore-keys: |
gems@v1-${{ matrix.os }}-${{ env.ImageVersion }}-Ruby${{ matrix.ruby }}-
- name: Run bundle install
run: |
gem install bundler -v "~> 1.17"
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3 --without debugging documentation
- uses: actions/cache/save@v4
id: bundle-cache-save
with:
path: vendor/bundle
key: ${{ steps.bundle-cache-restore.outputs.cache-primary-key }}
- name: Set up git identity
run: |
git config --global user.email "[email protected]"
git config --global user.name "CocoaPods Tests"
- uses: maxim-lobanov/setup-xcode@v1
if: ${{ matrix.task == 'EXAMPLES' }}
with:
xcode-version: 15.4
- name: Run Tests
run: bundle exec rake spec:all
env:
COCOAPODS_CI_TASKS: ${{ matrix.task }}
GENERATE_COVERAGE: ${{ matrix.coverage }}
- name: Publish Code Coverage
uses: paambaati/[email protected]
if: ${{ github.ref_name == 'master' && matrix.coverage == '1' }}
env:
CC_TEST_REPORTER_ID: 501acd9bc61d80ef6119b69ab42c52fa66cefddcc6724a1e93a79c3d3e32bf55
on:
push:
branches:
- "master"
- "*-stable"
pull_request:
branches:
- master
- "*-stable"