From 4e5abfa47c9364498dae583b8197fee08b5a76a2 Mon Sep 17 00:00:00 2001 From: alephao <7674479+alephao@users.noreply.github.com> Date: Sat, 14 Sep 2024 16:02:41 -0300 Subject: [PATCH] ci: add ci jobs test and codecov --- .github/workflows/ci.yml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/ci.yml 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