Skip to content

chore(ci): upgrade to codecov v4 #888

chore(ci): upgrade to codecov v4

chore(ci): upgrade to codecov v4 #888

name: Github Actions Swift Standard
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test-and-standard-upload:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v2
- run: pip install requests
- name: Install xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Xcode Version
run: xcodebuild -version
- name: Build and Test
run: |
xcodebuild -scheme standard-swift -sdk iphonesimulator -derivedDataPath Build/ -destination 'platform=iOS Simulator,name=iPhone 14,OS=16.2' -enableCodeCoverage YES clean build test
cd Build/Build/ProfileData
cd $(ls -d */|head -n 1)
directory=${PWD##*/}
pathCoverage=Build/Build/ProfileData/${directory}/Coverage.profdata
cd ../../../../
xcrun llvm-cov export -format="lcov" -instr-profile $pathCoverage Build/Build/Products/Debug-iphonesimulator/standard-swift.app/standard-swift > info.lcov
- name: Upload to Codecov
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_ORG_TOKEN }}
- name: Test coverage vaulue
run: python request.py
env:
API_KEY: ${{ secrets.API_KEY }}
CORRECT_COVERAGE: ${{ secrets.CORRECT_COVERAGE }}
- name: Upstream to Standards
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
COVERAGE_SOURCE_FILE: ${{ secrets.COVERAGE_SOURCE_FILE }}
if: ${{ github.event_name == 'push'}}
run: |
wget --header "Authorization: token ${GH_TOKEN}" \
--header "Accept: application/vnd.github.v3.raw" \
https://api.github.com/repos/codecov/standards/contents/upstream.sh
bash upstream.sh