diff --git a/.github/workflows/flare.yml b/.github/workflows/flare.yml index 47c5a621f..3b177b48c 100644 --- a/.github/workflows/flare.yml +++ b/.github/workflows/flare.yml @@ -16,16 +16,6 @@ on: - "Tests/**" jobs: - SwiftLint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: GitHub Action for SwiftLint - uses: sinoru/actions-swiftlint@v6 - with: - args: --strict - env: - DIFF_BASE: ${{ github.base_ref }} macOS: name: ${{ matrix.name }} runs-on: ${{ matrix.runsOn }} @@ -57,16 +47,12 @@ jobs: -destination "platform=macOS" \ -enableCodeCoverage YES \ -resultBundlePath "test_output/${{ matrix.name }}.xcresult" || exit 1 - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3.1.0 - with: - token: ${{ secrets.CODECOV_TOKEN }} - xcode: true - xcode_archive_path: test_output/${{ matrix.name }}.xcresult - - uses: actions/upload-artifact@v4 + - name: Upload test coverage reports to Codecov + uses: ./.github/actions/upload_test_coverage_report with: - name: ${{ matrix.name }} - path: test_output + scheme_name: Flare + filename: ${{ matrix.name }} + codecov_token: ${{ secrets.CODECOV_TOKEN }} iOS: name: ${{ matrix.name }} @@ -100,10 +86,12 @@ jobs: -testPlan AllTests \ -enableCodeCoverage YES \ -resultBundlePath "test_output/${{ matrix.name }}.xcresult" || exit 1 - - uses: actions/upload-artifact@v4 + - name: Upload test coverage reports to Codecov + uses: ./.github/actions/upload_test_coverage_report with: - name: ${{ matrix.name }} - path: test_output + scheme_name: Flare + filename: ${{ matrix.name }} + codecov_token: ${{ secrets.CODECOV_TOKEN }} tvOS: name: ${{ matrix.name }} @@ -138,7 +126,7 @@ jobs: -enableCodeCoverage YES \ -resultBundlePath "test_output/${{ matrix.name }}.xcresult" || exit 1 - name: Upload test coverage reports to Codecov - uses: ./.github/actions/upload_test_coverage_report.yml + uses: ./.github/actions/upload_test_coverage_report with: scheme_name: Flare filename: ${{ matrix.name }} @@ -180,16 +168,12 @@ jobs: -testPlan UnitTests \ -enableCodeCoverage YES \ -resultBundlePath "test_output/${{ matrix.name }}.xcresult" || exit 1 - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3.1.0 - with: - token: ${{ secrets.CODECOV_TOKEN }} - xcode: true - xcode_archive_path: test_output/${{ matrix.name }}.xcresult - - uses: actions/upload-artifact@v4 + - name: Upload test coverage reports to Codecov + uses: ./.github/actions/upload_test_coverage_report with: - name: ${{ matrix.name }} - path: test_output + scheme_name: Flare + filename: ${{ matrix.name }} + codecov_token: ${{ secrets.CODECOV_TOKEN }} spm: name: ${{ matrix.name }} diff --git a/.github/workflows/flare_ui.yml b/.github/workflows/flare_ui.yml index d95d3fd56..54f09f97b 100644 --- a/.github/workflows/flare_ui.yml +++ b/.github/workflows/flare_ui.yml @@ -16,16 +16,6 @@ on: - "Tests/FlareUITests/**" jobs: - SwiftLint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: GitHub Action for SwiftLint - uses: sinoru/actions-swiftlint@v6 - with: - args: --strict - env: - DIFF_BASE: ${{ github.base_ref }} macOS: name: ${{ matrix.name }} runs-on: ${{ matrix.runsOn }} @@ -57,16 +47,12 @@ jobs: -destination "platform=macOS" \ -enableCodeCoverage YES \ -resultBundlePath "test_output/${{ matrix.name }}.xcresult" || exit 1 - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3.1.0 + - name: Upload test coverage reports to Codecov + uses: ./.github/actions/upload_test_coverage_report with: - token: ${{ secrets.CODECOV_TOKEN }} - xcode: true - xcode_archive_path: test_output/${{ matrix.name }}.xcresult - - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.name }} - path: test_output + scheme_name: FlareUI + filename: ${{ matrix.name }} + codecov_token: ${{ secrets.CODECOV_TOKEN }} iOS: name: ${{ matrix.name }} @@ -100,10 +86,12 @@ jobs: -testPlan FlareUI \ -enableCodeCoverage YES \ -resultBundlePath "test_output/${{ matrix.name }}.xcresult" || exit 1 - - uses: actions/upload-artifact@v4 + - name: Upload test coverage reports to Codecov + uses: ./.github/actions/upload_test_coverage_report with: - name: ${{ matrix.name }} - path: test_output + scheme_name: FlareUI + filename: ${{ matrix.name }} + codecov_token: ${{ secrets.CODECOV_TOKEN }} tvOS: name: ${{ matrix.name }} @@ -137,16 +125,12 @@ jobs: -testPlan FlareUI \ -enableCodeCoverage YES \ -resultBundlePath "test_output/${{ matrix.name }}.xcresult" || exit 1 - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3.1.0 - with: - token: ${{ secrets.CODECOV_TOKEN }} - xcode: true - xcode_archive_path: test_output/${{ matrix.name }}.xcresult - - uses: actions/upload-artifact@v4 + - name: Upload test coverage reports to Codecov + uses: ./.github/actions/upload_test_coverage_report with: - name: ${{ matrix.name }} - path: test_output + scheme_name: FlareUI + filename: ${{ matrix.name }} + codecov_token: ${{ secrets.CODECOV_TOKEN }} watchOS: name: ${{ matrix.name }} @@ -184,16 +168,12 @@ jobs: -testPlan FlareUI \ -enableCodeCoverage YES \ -resultBundlePath "test_output/${{ matrix.name }}.xcresult" || exit 1 - - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v3.1.0 + - name: Upload test coverage reports to Codecov + uses: ./.github/actions/upload_test_coverage_report with: - token: ${{ secrets.CODECOV_TOKEN }} - xcode: true - xcode_archive_path: test_output/${{ matrix.name }}.xcresult - - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.name }} - path: test_output + scheme_name: FlareUI + filename: ${{ matrix.name }} + codecov_token: ${{ secrets.CODECOV_TOKEN }} spm: name: ${{ matrix.name }} diff --git a/.github/workflows/swiftlint.yml b/.github/workflows/swiftlint.yml new file mode 100644 index 000000000..4d09696c0 --- /dev/null +++ b/.github/workflows/swiftlint.yml @@ -0,0 +1,26 @@ +name: "swiftlint" + +on: + push: + branches: + - main + - dev + pull_request: + paths: + - '.swiftlint.yml' + - ".github/workflows/**" + - "Package@swift-5.7.swift" + - "Package@swift-5.8.swift" + - "Package.swift" + - "Source/**" + - "Tests/**" + +jobs: + SwiftLint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: GitHub Action for SwiftLint + uses: norio-nomura/action-swiftlint@3.2.1 + with: + args: lint --config ./.swiftlint.yml --strict \ No newline at end of file