Skip to content
Latchkey

BDD Integration Tests workflow (openwallet-foundation/acapy)

The BDD Integration Tests workflow from openwallet-foundation/acapy, explained and optimized by Latchkey.

A

CI health: A - excellent

Point runs-on at Latchkey and get job timeouts, self-healing for flaky steps, and up to 58% lower cost, applied automatically.

Grade your own workflow free or run it on Latchkey →
Source: openwallet-foundation/acapy.github/workflows/bdd-integration-tests.ymlLicense Apache-2.0View source

What it does

This is the BDD Integration Tests workflow from the openwallet-foundation/acapy repository, a real project running GitHub Actions. It is shown here with attribution under its Apache-2.0 license.

Below, Latchkey shows a faster, safer version produced by its optimization engine.

The workflow

workflow (.yml)
name: BDD Integration Tests

on:
  schedule:
    - cron: '0 0 * * *'
  workflow_dispatch:
  pull_request:
    branches:
      - main
    types: [opened, synchronize, reopened, ready_for_review]

permissions:
  checks: write

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

defaults:
  run:
    shell: bash

jobs:
  test:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: read
      checks: write
    # Run on openwallet-foundation and non-draft PRs or on non-PR events
    if: (github.repository == 'openwallet-foundation/acapy') && ((github.event_name == 'pull_request' && github.event.pull_request.draft == false) || (github.event_name != 'pull_request'))
    outputs:
      is_release: ${{ steps.check_if_release.outputs.is_release }}
    steps:
      - name: checkout-acapy
        uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
        with:
          fetch-depth: 0
      - name: Check changed files
        id: check-changed-files
        uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6
        with:
          files_yaml: |
            src: 
              - acapy_agent/**/*
              - poetry.lock
              - pyproject.toml
              - docker/*
            demo: "demo/**/*"
      - name: Check if demo or src files changed
        id: check-if-demo-or-src-changed
        run: |
          if [ "${{ steps.check-changed-files.outputs.demo_any_changed }}" != "true" ] && [ "${{ steps.check-changed-files.outputs.src_any_changed }}" != "true" ] && [ '${{ github.event_name }}' == 'pull_request' ]; then
            echo "No demo or src files changed..."
            echo run_tests=false >> $GITHUB_OUTPUT
          fi
      - name: Check if PR is a release
        if: steps.check-if-demo-or-src-changed.outputs.run_tests != 'false'
        uses: ./.github/actions/is-release
        id: check_if_release
      - name: Run PR or Nightly Integration Tests
        if: (steps.check_if_release.outputs.is_release != 'true' && steps.check-if-demo-or-src-changed.outputs.run_tests != 'false')
        uses: ./.github/actions/run-integration-tests
      - name: Run Release Integration Tests
        if: (steps.check_if_release.outputs.is_release == 'true' && steps.check-if-demo-or-src-changed.outputs.run_tests != 'false')
        uses: ./.github/actions/run-integration-tests
        with:
          TEST_SCOPE: "-t @Release -t ~@BBS"

The same workflow, on Latchkey

Removes redundant runs and caps runaway jobs. Added and changed lines are highlighted.

name: BDD Integration Tests
 
on:
  schedule:
    - cron: '0 0 * * *'
  workflow_dispatch:
  pull_request:
    branches:
      - main
    types: [opened, synchronize, reopened, ready_for_review]
 
permissions:
  checks: write
 
concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true
 
defaults:
  run:
    shell: bash
 
jobs:
  test:
    timeout-minutes: 30
    runs-on: latchkey-small
    permissions:
      contents: read
      pull-requests: read
      checks: write
    # Run on openwallet-foundation and non-draft PRs or on non-PR events
    if: (github.repository == 'openwallet-foundation/acapy') && ((github.event_name == 'pull_request' && github.event.pull_request.draft == false) || (github.event_name != 'pull_request'))
    outputs:
      is_release: ${{ steps.check_if_release.outputs.is_release }}
    steps:
      - name: checkout-acapy
        uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
        with:
          fetch-depth: 0
      - name: Check changed files
        id: check-changed-files
        uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6
        with:
          files_yaml: |
            src: 
              - acapy_agent/**/*
              - poetry.lock
              - pyproject.toml
              - docker/*
            demo: "demo/**/*"
      - name: Check if demo or src files changed
        id: check-if-demo-or-src-changed
        run: |
          if [ "${{ steps.check-changed-files.outputs.demo_any_changed }}" != "true" ] && [ "${{ steps.check-changed-files.outputs.src_any_changed }}" != "true" ] && [ '${{ github.event_name }}' == 'pull_request' ]; then
            echo "No demo or src files changed..."
            echo run_tests=false >> $GITHUB_OUTPUT
          fi
      - name: Check if PR is a release
        if: steps.check-if-demo-or-src-changed.outputs.run_tests != 'false'
        uses: ./.github/actions/is-release
        id: check_if_release
      - name: Run PR or Nightly Integration Tests
        if: (steps.check_if_release.outputs.is_release != 'true' && steps.check-if-demo-or-src-changed.outputs.run_tests != 'false')
        uses: ./.github/actions/run-integration-tests
      - name: Run Release Integration Tests
        if: (steps.check_if_release.outputs.is_release == 'true' && steps.check-if-demo-or-src-changed.outputs.run_tests != 'false')
        uses: ./.github/actions/run-integration-tests
        with:
          TEST_SCOPE: "-t @Release -t ~@BBS"
 

What changed

This workflow runs 1 job per trigger. On Latchkey the same minutes cost up to 58% less than GitHub-hosted, with zero queue time.

Actions used in this workflow