Skip to content

Exports code coverage #132

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 38 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

jobs:
formatlint:
name: Lint for correct formatting
name: Format linting
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -24,41 +24,63 @@ jobs:
run: docker run --rm -v ${{ github.workspace }}:/repo ghcr.io/nicklockwood/swiftformat:latest /repo --lint

macos:
name: Build and test on macos-latest
name: Test on macOS
runs-on: macos-latest
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest
- uses: actions/checkout@v3
- name: Build and test
run: swift test --parallel --enable-test-discovery

linux:
name: Test on Linux
runs-on: ubuntu-latest
steps:
- uses: swift-actions/setup-swift@v1
- uses: actions/checkout@v3
- name: Test
run: swift test
run: swift test --parallel --enable-code-coverage
- name: Get test coverage html
run: |
llvm-cov show \
$(swift build --show-bin-path)/GraphQLPackageTests.xctest \
--instr-profile $(swift build --show-bin-path)/codecov/default.profdata \
--ignore-filename-regex="\.build|Tests" \
--format html \
--output-dir=.test-coverage
- name: Upload test coverage html
uses: actions/upload-artifact@v3
with:
name: test-coverage-report
path: .test-coverage

# ubuntu-latest is ubuntu-22.04 currently. Swift versions older than 5.7 don't have builds for 22.04. https://www.swift.org/download/
ubuntu-old:
name: Build ${{ matrix.swift }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
backcompat-ubuntu-22_04:
name: Test Swift ${{ matrix.swift }} on Ubuntu 22.04
runs-on: ubuntu-22.04
strategy:
matrix:
os: [ubuntu-20.04]
swift: ["5.5", "5.6"]
swift: ["5.7", "5.8"]
steps:
- uses: swift-actions/setup-swift@v1
with:
swift-version: ${{ matrix.swift }}
- uses: actions/checkout@v3
- name: Test
run: swift test
run: swift test --parallel

ubuntu-latest:
name: Build ${{ matrix.swift }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
# Swift versions older than 5.7 don't have builds for 22.04. https://www.swift.org/download/
backcompat-ubuntu-20_04:
name: Test Swift ${{ matrix.swift }} on Ubuntu 20.04
runs-on: ubuntu-20.04
strategy:
matrix:
os: [ubuntu-latest]
swift: ["5.7", "5.8", "5.9"]
swift: ["5.5", "5.6"]
steps:
- uses: swift-actions/setup-swift@v1
with:
swift-version: ${{ matrix.swift }}
- uses: actions/checkout@v3
- name: Test
run: swift test
run: swift test --parallel
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@
### SwiftPM ###
.build/
.swiftpm/

### CI Artifacts ###
/.test-coverage