name: Build and Test

on: [push, pull_request]

jobs:
  build:

    runs-on: macOS-latest

    steps:
    - uses: actions/checkout@v2
    - name: Build and Test for macOS
      run: swift test --enable-code-coverage
    - name: Upload Code coverage
      run: |
        curl -Os https://uploader.codecov.io/latest/macos/codecov
        chmod +x codecov
        codecovpath=$(swift test --show-codecov-path)
        ./codecov -f $codecovpath

name: Build and Test

on: [push, pull_request, workflow_dispatch]

jobs:
  build:

    runs-on: macOS-latest

    steps:
    - uses: actions/checkout@v2
    - name: Build and Test for macOS
      run: swift test --enable-code-coverage
    - name: Upload Code coverage
      run: |
        curl -Os https://uploader.codecov.io/latest/macos/codecov
        chmod +x codecov
        xcrun llvm-cov export -format="lcov" .build/debug/opentelemetry-swiftPackageTests.xctest/Contents/MacOS/opentelemetry-swiftPackageTests -instr-profile .build/debug/codecov/default.profdata > .build/debug/codecov/coverage_report.lcov
        ./codecov -f .build/debug/codecov/coverage_report.lcov

Fix codecov report by generating lcov file
Fix codecov report by generating lcov file
