diff --git a/.gitea/workflows/common_build.yml b/.gitea/workflows/common_build.yml index 0744cb2..378638d 100644 --- a/.gitea/workflows/common_build.yml +++ b/.gitea/workflows/common_build.yml @@ -16,9 +16,47 @@ jobs: with: distribution: 'temurin' java-version: '17' + cache: gradle - name: Setup Android SDK uses: android-actions/setup-android@v3 - name: Configure gradle... run: mkdir -p ~/.gradle && echo "org.gradle.daemon=false\nignoreGitVersion=true" >> ~/.gradle/gradle.properties - name: Build and test - run: ./gradlew build -x test --stacktrace \ No newline at end of file + run: ./gradlew build -x testReleaseUnitTest -x testDebugUnitTest -x testGithubConfigReleaseUnitTest -x testGithubConfigDebugUnitTest # These tests will be done in the next step + coverage: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Fetch tags + run: git fetch --tags -p + - uses: KengoTODA/actions-setup-docker-compose@v1 + with: + version: "2.23.3" + - name: run selfoss + run: | + docker compose -f .gitea/workflows/assets/docker-compose.yml up -d + - uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: '17' + cache: gradle + - uses: gradle/actions/setup-gradle@v3 + - uses: android-actions/setup-android@v3 + - name: Configure gradle... + run: mkdir -p ~/.gradle && echo "org.gradle.daemon=false\nignoreGitVersion=true" >> ~/.gradle/gradle.properties + - name: coverage + run: | + ./gradlew :koverHtmlReport + - uses: actions/upload-artifact@v3 + with: + name: coverage + path: build/reports/kover/html + retention-days: 1 + overwrite: true + include-hidden-files: true + - name: Clean + if: always() + run: | + docker compose -f .gitea/workflows/assets/docker-compose.yml stop \ No newline at end of file diff --git a/.gitea/workflows/on_merge_on_release.yml b/.gitea/workflows/on_merge_on_release.yml index 4c4241f..800fc03 100644 --- a/.gitea/workflows/on_merge_on_release.yml +++ b/.gitea/workflows/on_merge_on_release.yml @@ -85,6 +85,7 @@ jobs: with: distribution: 'temurin' java-version: '17' + cache: gradle - name: Setup Android SDK uses: android-actions/setup-android@v3 - name: Configure gradle... diff --git a/.gitea/workflows/on_pr.yml b/.gitea/workflows/on_pr.yml index 81aa997..d49e140 100644 --- a/.gitea/workflows/on_pr.yml +++ b/.gitea/workflows/on_pr.yml @@ -12,8 +12,9 @@ jobs: uses: actions/checkout@v4 - uses: actions/setup-java@v4 with: - distribution: 'temurin' # See 'Supported distributions' for available options + distribution: 'temurin' java-version: '17' + cache: gradle - name: Install klint run: curl -sSLO https://github.com/pinterest/ktlint/releases/download/1.0.0/ktlint && chmod a+x ktlint && mv ktlint /usr/local/bin/ - name: Install detekt diff --git a/.gitea/workflows/on_push_coverage.yml b/.gitea/workflows/on_push_coverage.yml deleted file mode 100644 index aa326e6..0000000 --- a/.gitea/workflows/on_push_coverage.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Check master code -on: - push: - branches: - - master - -jobs: - coverage: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: Fetch tags - run: git fetch --tags -p - - uses: KengoTODA/actions-setup-docker-compose@v1 - with: - version: "2.23.3" - - name: run selfoss - run: | - docker compose -f .gitea/workflows/assets/docker-compose.yml up -d - - uses: actions/setup-java@v4 - with: - distribution: 'temurin' - java-version: '17' - cache: gradle - - uses: gradle/actions/setup-gradle@v3 - - uses: android-actions/setup-android@v3 - - name: Configure gradle... - run: mkdir -p ~/.gradle && echo "org.gradle.daemon=false\nignoreGitVersion=true" >> ~/.gradle/gradle.properties - - name: coverage - run: | - ./gradlew :koverHtmlReport - - uses: actions/upload-artifact@v3 - with: - name: coverage - path: build/reports/kover/html - retention-days: 1 - overwrite: true - include-hidden-files: true - - name: Clean - if: always() - run: | - docker compose -f .gitea/workflows/assets/docker-compose.yml stop \ No newline at end of file