diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..89f7ba8 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,16 @@ +name: lint + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + swiftlint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: SwiftLint + uses: norio-nomura/action-swiftlint@3.2.1 diff --git a/.github/workflows/swift.yml b/.github/workflows/swift.yml new file mode 100644 index 0000000..552c024 --- /dev/null +++ b/.github/workflows/swift.yml @@ -0,0 +1,32 @@ +name: swift + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +env: + LCOV_PATH: .build/artifacts/info.lcov + BUILD_FOLDER: .build/debug/AppliablePackageTests.xctest/Contents/MacOS/AppliablePackageTests + PROFDATA_FOLDER: .build/debug/codecov/default.profdata + +jobs: + test: + runs-on: macos-latest + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Test + run: | + swift test --enable-code-coverage + xcrun llvm-cov report $BUILD_FOLDER -instr-profile $PROFDATA_FOLDER + xcrun llvm-cov export -format="lcov" $BUILD_FOLDER -instr-profile $PROFDATA_FOLDER > $LCOV_PATH + + - name: Upload Coverage Data + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: ${{ env.LCOV_PATH }}