Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refine workflows #359

Merged
merged 3 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Sanity
name: Task proposal

on:
pull_request:
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
name: Everything is fine
needs: [up-to-binaries]
runs-on: ubuntu-latest
timeout-minutes: 10
timeout-minutes: 5
if: ${{ always() }}
steps:
- if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'skipped') || contains(needs.*.result, 'cancelled') }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
---
name: Convincing
name: Work change

on:
pull_request:
types: [synchronize]
branches:
- main
workflow_dispatch:
Expand Down Expand Up @@ -81,7 +82,7 @@ jobs:
name: Everything is fine
needs: [up-to-images]
runs-on: ubuntu-latest
timeout-minutes: 10
timeout-minutes: 5
if: ${{ always() }}
steps:
- if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'skipped') || contains(needs.*.result, 'cancelled') }}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
---
name: Beyond doubt
name: Work proposal

on:
merge_group:
branches:
- main
pull_request:
types: [opened, reopened]
branches:
- main
workflow_dispatch:

env:
Expand Down Expand Up @@ -32,15 +36,6 @@ jobs:
with:
devenv: ${{ matrix.env.dev }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run ansible-playbook sources.yaml
run: >-
docker run --rm
--volume $(pwd):$(pwd)
--volume ~/.m2:/root/.m2
--workdir $(pwd)/baker/ansible
${{ env.IMAGE_NAME }}:${{ matrix.env.dev }}
ansible-playbook sources.yaml
-e devenv=${{ matrix.env.dev }}
- name: Run ansible-playbook images.yaml
id: images
run: >-
Expand Down Expand Up @@ -219,7 +214,7 @@ jobs:
timeout-minutes: 5
needs: [stack-checking]
if: ${{ !cancelled() && (contains(needs.*.result, 'success') || contains(needs.*.result, 'failure')) }}
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
permissions:
checks: write
steps:
Expand All @@ -237,7 +232,7 @@ jobs:
name: Everything is fine
needs: [stack-publishing, stack-reporting]
runs-on: ubuntu-latest
timeout-minutes: 10
timeout-minutes: 5
if: ${{ always() }}
steps:
- if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'skipped') || contains(needs.*.result, 'cancelled') }}
Expand Down
42 changes: 25 additions & 17 deletions baker/ansible/tasks/app/build-and-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,30 @@
- name: Build binaries
ansible.builtin.command:
cmd: >-
mvn
--no-snapshot-updates
--batch-mode
--fail-fast
--threads 2
--projects {{
image_status.results
| select('changed')
| map(attribute='app.binary')
| map('regex_replace', '^', ':')
| join(',')
}}
--also-make
clean
{{ maven_phase | mandatory }}
--define devenv={{ devenv }}
mvn clean {{ maven_phase|mandatory }}
--no-snapshot-updates
--batch-mode
--fail-fast
--threads 2
{% if image_status is defined %}
--projects {{
image_status.results
| select('changed')
| map(attribute='app.binary')
| map('regex_replace', '^', ':')
| join(',')
}}
{% else %}
--projects {{
product.apps.values()
| flatten
| map(attribute='binary')
| map('regex_replace', '^', ':')
| join(',')
}}
{% endif %}
--also-make
--define devenv={{ devenv }}
chdir: "{{ project.dir }}"
strip_empty_ends: false
changed_when: true
Expand All @@ -28,7 +36,7 @@
mvn
--no-snapshot-updates
--batch-mode
--projects tool
--projects :tool
clean
antrun:run@coverage
chdir: "{{ project.dir }}"
Expand Down
2 changes: 1 addition & 1 deletion baker/ansible/tasks/product/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
--no-snapshot-updates
--batch-mode
--threads 2
--projects test/e2e
--projects :e2e
{% if hostvars.gear.is_virtual.rc == 0 %}
--activate-profiles docker
{% endif %}
Expand Down