Skip to content

Beyond doubt

Beyond doubt #107

Workflow file for this run

---
name: Beyond doubt
on:
merge_group:
branches:
- main
workflow_dispatch:
env:
IMAGE_NAME: stack/gear
BINARY_REPO: maven.pkg.github.com
IMAGE_REPO: ghcr.io
jobs:
up-to-images:
name: Up to images (${{ matrix.env.dev }})
timeout-minutes: 10
permissions:
checks: write
packages: write
strategy:
fail-fast: false
matrix:
env:
- dev: godel
- dev: turing
- dev: church
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Run setup-gear
uses: ./.github/actions/setup-gear
with:
devenv: ${{ matrix.env.dev }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run setup-maven
uses: ./.github/actions/setup-maven
- name: Run ansible-playbook sources.yaml
run: >-
docker run --rm
--volume $(pwd):$(pwd)
--volume ~/.m2:/root/.m2
--workdir $(pwd)/bakers/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: >-
docker run --rm
--volume $(pwd):$(pwd)
--volume ~/.m2:/root/.m2
--volume /var/run/docker.sock:/var/run/docker.sock
--volume ~/.docker/config.json:/root/.docker/config.json:ro
--env GITHUB_ACTOR=${{ github.actor }}
--env GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
--workdir $(pwd)/bakers/ansible
${{ env.IMAGE_NAME }}:${{ matrix.env.dev }}
ansible-playbook images.yaml -v
-e devenv=${{ matrix.env.dev }}
-e binary_repo=${{ env.BINARY_REPO }}
-e image_repo=${{ env.IMAGE_REPO }}
- uses: mikepenz/[email protected]
if: ${{ !cancelled() && (steps.images.outcome == 'success' || steps.images.outcome == 'failure') }}
with:
check_name: Unit test report (${{ matrix.env.dev }})
report_paths: "**/target/surefire-reports/TEST-*.xml"
require_tests: "${{ steps.images.outcome == 'failure' }}"
fail_on_failure: false
job_summary: false
- uses: mikepenz/[email protected]
if: ${{ !cancelled() && (steps.images.outcome == 'success' || steps.images.outcome == 'failure') }}
with:
check_name: Integration test report (${{ matrix.env.dev }})
report_paths: "**/target/failsafe-reports/TEST-*.xml"
require_tests: "${{ steps.images.outcome == 'failure' }}"
fail_on_failure: false
job_summary: false
stack-building:
name: Stack building (${{ matrix.env.dev }}, ${{ matrix.env.ops }})
timeout-minutes: 5
needs: [up-to-images]
strategy:
fail-fast: false
matrix:
purpose: [func]
env:
- dev: godel
ops: marx
- dev: turing
ops: durkheim
- dev: turing
ops: veblen
- dev: church
ops: commons
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Run setup-gear
uses: ./.github/actions/setup-gear
with:
devenv: ${{ matrix.env.dev }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run ansible-playbook stacks.yaml -t build
run: >-
docker run --rm
--volume $(pwd):$(pwd)
--workdir $(pwd)/bakers/ansible
${{ env.IMAGE_NAME }}:${{ matrix.env.dev }}
ansible-playbook stacks.yaml -t build
-e image_repo=${{ env.IMAGE_REPO }}
-e devenv=${{ matrix.env.dev }}
-e purpose=${{ matrix.purpose }}
-e opsenv=${{ matrix.env.ops }}
- uses: actions/[email protected]
with:
name: solution-${{ matrix.purpose }}-${{ matrix.env.ops }}
path: stack/solution/target/image-context
if-no-files-found: ignore
stack-testing:
name: Stack testing (${{ matrix.shard }}, ${{ matrix.purpose }}, ${{ matrix.env.ops }})
timeout-minutes: 15
needs: [stack-building]
strategy:
fail-fast: false
matrix:
purpose: [func]
shard: [0, 1]
env:
- dev: godel
ops: marx
- dev: turing
ops: durkheim
- dev: turing
ops: veblen
- dev: church
ops: commons
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Run setup-gear
uses: ./.github/actions/setup-gear
with:
devenv: ${{ matrix.env.dev }}
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/[email protected]
continue-on-error: true # it's ok because stack building can be skipped
with:
name: solution-${{ matrix.purpose }}-${{ matrix.env.ops }}
path: stack/solution/target/image-context
- name: Run setup-maven
uses: ./.github/actions/setup-maven
- name: Run ansible-playbook stacks.yaml -t test
run: >-
docker run --rm
--volume $(pwd):$(pwd)
--volume ~/.m2:/root/.m2
--volume /var/run/docker.sock:/var/run/docker.sock
--workdir $(pwd)/bakers/ansible
${{ env.IMAGE_NAME }}:${{ matrix.env.dev }}
ansible-playbook stacks.yaml -t test
-e image_repo=${{ env.IMAGE_REPO }}
-e devenv=${{ matrix.env.dev }}
-e purpose=${{ matrix.purpose }}
-e opsenv=${{ matrix.env.ops }}
-e reminder=${{ matrix.shard }}
-e modulus=2
- uses: actions/[email protected]
if: ${{ !cancelled() }}
with:
name: e2e-test-report-${{ matrix.shard }}-${{ matrix.purpose }}-${{ matrix.env.ops }}
path: tests/e2e/target/surefire-reports/*.xml
if-no-files-found: ignore
stack-publishing:
name: Stack publishing (${{ matrix.purpose }}, ${{ matrix.env.ops }})
timeout-minutes: 10
needs: [stack-testing]
strategy:
fail-fast: false
matrix:
purpose: [func]
env:
- dev: godel
ops: marx
- dev: turing
ops: durkheim
- dev: turing
ops: veblen
- dev: church
ops: commons
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/[email protected]
- name: Run setup-gear
uses: ./.github/actions/setup-gear
with:
devenv: ${{ matrix.env.dev }}
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/[email protected]
continue-on-error: true # it's ok because stack building can be skipped
with:
name: solution-${{ matrix.purpose }}-${{ matrix.env.ops }}
path: stack/solution/target/image-context
- name: Run ansible-playbook stacks.yaml -t package
run: >-
docker run --rm
--volume $(pwd):$(pwd)
--volume /var/run/docker.sock:/var/run/docker.sock
--volume ~/.docker/config.json:/root/.docker/config.json:ro
--workdir $(pwd)/bakers/ansible
${{ env.IMAGE_NAME }}:${{ matrix.env.dev }}
ansible-playbook stacks.yaml -t package -v
-e image_repo=${{ env.IMAGE_REPO }}
-e devenv=${{ matrix.env.dev }}
-e purpose=${{ matrix.purpose }}
-e opsenv=${{ matrix.env.ops }}
stack-reporting:
name: Stack reporting
timeout-minutes: 5
needs: [stack-testing]
if: ${{ !cancelled() && (contains(needs.*.result, 'success') || contains(needs.*.result, 'failure')) }}
runs-on: ubuntu-22.04
permissions:
checks: write
steps:
- uses: actions/[email protected]
with:
path: artifacts
- uses: mikepenz/[email protected]
with:
check_name: E2E test report
report_paths: "artifacts/e2e-test-report-*/**/TEST-*.xml"
fail_on_failure: false
job_summary: false
everything-is-fine:
name: Everything is fine
needs: [stack-publishing, stack-reporting]
runs-on: ubuntu-latest
timeout-minutes: 10
if: ${{ always() }}
steps:
- if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'skipped') || contains(needs.*.result, 'cancelled') }}
run: |
echo "::error::Something went wrong"
exit 1