Skip to content

Commit

Permalink
Merge pull request #1008 from Annopaolo/fix-workflows-dependencies
Browse files Browse the repository at this point in the history
Workflows: ensure dependencies on tests before publishing images
  • Loading branch information
davidebriani authored Oct 25, 2024
2 parents 82e0f14 + 7a9bead commit ed497c0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/astarte-apps-build-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ on:
paths:
- 'apps/**'
- '.github/workflows/astarte-apps-build-workflow.yaml'
# Allow this workflow to be called by others
workflow_call:

env:
elixir_version: "1.15"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/astarte-end-to-end-test-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ on:
- 'apps/**'
- 'tools/astarte_e2e/**'
- '.github/workflows/astarte-end-to-end-test-workflow.yaml'
# Allow this workflow to be called by others
workflow_call:

env:
elixir_version: "1.15"
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/publish-release-to-dockerhub-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ on:
types: [published]

jobs:
container_tests:
uses: ./.github/workflows/astarte-apps-build-workflow.yaml

e2e_tests:
uses: ./.github/workflows/astarte-end-to-end-test-workflow.yaml

push_release_to_registry:
name: Push Docker images to Docker Hub
runs-on: ubuntu-22.04
Expand All @@ -30,7 +36,9 @@ jobs:
- astarte_realm_management
- astarte_realm_management_api
- astarte_trigger_engine
needs: [test-coverage, end-to-end-test]
needs:
- container_tests
- e2e_tests
steps:
- name: Check out the repo
uses: actions/checkout@v4
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/publish-snapshot-to-dockerhub-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ on:
- 'release-*'

jobs:
container_tests:
uses: ./.github/workflows/astarte-apps-build-workflow.yaml

e2e_tests:
uses: ./.github/workflows/astarte-end-to-end-test-workflow.yaml

push_snapshot_to_registry:
name: Push Docker images to Docker Hub
runs-on: ubuntu-22.04
Expand All @@ -23,6 +29,9 @@ jobs:
contents: read
attestations: write
id-token: write
needs:
- container_tests
- e2e_tests
strategy:
fail-fast: true
matrix:
Expand All @@ -36,7 +45,6 @@ jobs:
- astarte_realm_management
- astarte_realm_management_api
- astarte_trigger_engine
needs: [test-coverage, end-to-end-test]
steps:
- name: Check out the repo
uses: actions/checkout@v4
Expand Down

0 comments on commit ed497c0

Please sign in to comment.