diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ed06f37 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,40 @@ +name: CI + +on: + push: + branches: + - main + paths: + - '**.swift' + pull_request: + workflow_dispatch: +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-ci + cancel-in-progress: true + +jobs: + linux: + runs-on: ubuntu-latest + timeout-minutes: 5 + strategy: + matrix: + image: ["swift:5.8", "swift:5.9", "swift:5.10", "swiftlang/swift:nightly-6.0-jammy"] + + container: + image: ${{ matrix.image }} + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Test + run: | + swift test --enable-code-coverage + - name: Convert coverage files + run: | + llvm-cov export -format="lcov" \ + .build/debug/swift-http-types-htmxPackageTests.xctest \ + -ignore-filename-regex="\/Tests\/" \ + -instr-profile .build/debug/codecov/default.profdata > info.lcov + - name: Upload to codecov.io + uses: codecov/codecov-action@v4 + with: + file: info.lcov