From 77a0faa257df5ed48fff7c65e9e08a9f26fc54a7 Mon Sep 17 00:00:00 2001 From: Philipp Horstenkamp Date: Mon, 23 Oct 2023 19:43:53 +0200 Subject: [PATCH] Reduced build time (#260) The building and pushing of artifacts takes to long. With those changes build experimental images aren't pushed anymore. This saves build time and disc space. --- .github/dependabot.yml | 4 ++-- .github/workflows/maintenance.yaml | 2 +- .github/workflows/test-and-build-action.yaml | 13 +++++++++---- .pre-commit-config.yaml | 1 + 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 967a850..0767c1e 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,7 +8,7 @@ updates: - package-ecosystem: github-actions directory: / schedule: - interval: weekly + interval: daily open-pull-requests-limit: 10 - package-ecosystem: pip # See documentation for possible values directory: / # Location of package manifests @@ -17,4 +17,4 @@ updates: open-pull-requests-limit: 5 ignore: - dependency-name: '*' - update-types: ["version-update:semver-major"] + update-types: ['version-update:semver-major'] diff --git a/.github/workflows/maintenance.yaml b/.github/workflows/maintenance.yaml index 8eee5a3..a723e58 100644 --- a/.github/workflows/maintenance.yaml +++ b/.github/workflows/maintenance.yaml @@ -2,7 +2,7 @@ name: Auto Maintenance Cycle on: schedule: - - cron: 30 7 * * 1 + - cron: 30 7 * * * jobs: delete_all_untagged: diff --git a/.github/workflows/test-and-build-action.yaml b/.github/workflows/test-and-build-action.yaml index d5464f8..15ff166 100644 --- a/.github/workflows/test-and-build-action.yaml +++ b/.github/workflows/test-and-build-action.yaml @@ -54,6 +54,7 @@ jobs: if-no-files-found: error coverage_pull_request: + name: Coverage Report on pull request if: ${{ github.event_name == 'pull_request' && !startsWith(github.ref, 'refs/heads/dependabot/')}} runs-on: ubuntu-latest needs: test @@ -71,6 +72,7 @@ jobs: thresholdModified: 0.7 coverage_report: + name: Coverage HTML Report if: ${{ github.event_name == 'push' }} runs-on: ubuntu-latest needs: test @@ -162,7 +164,6 @@ jobs: echo "LATEST=experimental" >> $GITHUB_ENV fi - - run: | echo "Print ${{ env.TAG_OR_MAIN }}" @@ -177,6 +178,10 @@ jobs: if: ${{ github.event_name == 'pull_request' }} run: exit 0 + - name: Exit workflow on not main branch + if: ${{ github.ref != 'refs/heads/main'}} + run: exit 0 + - name: Login to GitHub Container Registry uses: docker/login-action@v3 with: @@ -189,7 +194,7 @@ jobs: with: build-args: | "GIT_HASH=${{github.sha}}" - push: true + push: ${{ github.ref == 'refs/heads/main'}} tags: | ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/ingest:${{ env.TAG_OR_MAIN }} ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/ingest:${{ env.LATEST }} @@ -201,7 +206,7 @@ jobs: with: build-args: | "GIT_HASH=${{github.sha}}" - push: true + push: ${{ github.ref == 'refs/heads/main'}} tags: | ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/data-transformation:${{ env.TAG_OR_MAIN }} ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/data-transformation:${{ env.LATEST }} @@ -213,7 +218,7 @@ jobs: with: build-args: | "GIT_HASH=${{github.sha}}" - push: true + push: ${{ github.ref == 'refs/heads/main'}} tags: | ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/web-server:${{ env.TAG_OR_MAIN }} ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/web-server:${{ env.LATEST }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2367db8..9dafcba 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -49,6 +49,7 @@ repos: args: [--autofix] - id: pretty-format-yaml args: [--autofix] + exclude: (dependabot.yml$) - id: pretty-format-toml args: [--autofix] exclude: (^poetry.lock$)