Skip to content

Commit

Permalink
Adjust nightly and release workflows
Browse files Browse the repository at this point in the history
Signed-off-by: jamshale <[email protected]>
  • Loading branch information
jamshale committed Aug 29, 2024
1 parent 8e3cdec commit 29d2f12
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 28 deletions.
34 changes: 34 additions & 0 deletions .github/actions/is-release/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Check if PR is a release
description: "Checks if the PR is a release"

runs:
using: "composite"
steps:
- name: Check if PR is a release
shell: bash
id: check_if_release
continue-on-error: true
run: |
# Get the diff between the current commit and the last merge commit on the upstream/main branch
git remote add upstream https://github.com/hyperledger/aries-cloudagent-python.git
git fetch upstream
last_merge=$(git rev-list --no-merges -n 1 upstream/main)
echo event = ${{ github.event_name }}
echo last upstream commit = "$last_merge"
echo current pr commit = "${{ github.sha }}"
echo Will exit with code 1 if the pull request is not a release
changes=$(git diff "${{ github.sha }}" "$last_merge" pyproject.toml)
# Extract the version of aries-cloudagent from the diff of pyproject.toml
version=$(echo "$changes" | grep -A1 'name = "aries_cloudagent"' | head -n 2 | tail -n 1 | awk '{print $3}' | tr -d '"')
echo "$version"
if [ "$version" ]; then
echo "This is a release because the aries-cloudagent version in pyproject.toml has changes"
echo is_release=true >> $GITHUB_OUTPUT
fi
30 changes: 3 additions & 27 deletions .github/workflows/bdd-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,37 +29,13 @@ jobs:
with:
fetch-depth: 0
- name: Check if PR is a release
uses: ./.github/actions/is-release
id: check_if_release
continue-on-error: true
run: |
# Get the diff between the current commit and the last merge commit on the upstream/main branch
git remote add upstream https://github.com/hyperledger/aries-cloudagent-python.git
git fetch upstream
last_merge=$(git rev-list --no-merges -n 1 upstream/main)
echo event = ${{ github.event_name }}
echo last upstream commit = "$last_merge"
echo current pr commit = "${{ github.sha }}"
echo Will exit with code 1 if the pull request is not a release
changes=$(git diff "${{ github.sha }}" "$last_merge" pyproject.toml)
# Extract the version of aries-cloudagent from the diff of pyproject.toml
version=$(echo "$changes" | grep -A1 'name = "aries_cloudagent"' | head -n 2 | tail -n 1 | awk '{print $3}' | tr -d '"')
echo "$version"
if [ "$version" ]; then
echo "This is a release because the aries-cloudagent version in pyproject.toml has changes"
echo is_release=true >> $GITHUB_OUTPUT
fi
- name: run-pr-integration-tests
uses: ./.github/actions/run-integration-tests
if: (steps.check_if_release.outputs.is_release != 'true' && github.event_name == 'pull_request')
if: (steps.check_if_release.outputs.is_release != 'true')
- name: run-release-or-cron-integration-tests
if: (steps.check_if_release.outputs.is_release == 'true' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch')
if: (steps.check_if_release.outputs.is_release == 'true')
uses: ./.github/actions/run-integration-tests
with:
TEST_SCOPE: "-t @Release -t ~@BBS"
15 changes: 14 additions & 1 deletion .github/workflows/bdd-interop-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: BDD Interop Integration Tests

on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
pull_request:
branches:
- main
Expand All @@ -25,14 +28,17 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check if PR is a release
uses: ./.github/actions/is-release
id: check_if_release
- name: Request GitHub API for PR data
uses: octokit/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
id: get_pr_data
with:
route: GET /repos/${{ github.event.repository.full_name }}/pulls/${{ github.event.number }}
- name: Run BDD Interop Tests
- name: Prepare Interop Tests
run: |
# Get AATH
git clone https://github.com/hyperledger/aries-agent-test-harness.git
Expand All @@ -42,5 +48,12 @@ jobs:
cat aries-agent-test-harness/aries-backchannels/acapy/requirements-main.txt
cd aries-agent-test-harness
./manage build -a acapy-main
- name: Run PR Interop Tests
if: (steps.check_if_release.outputs.is_release != 'true' && github.event_name == 'pull_request')
run: |
NO_TTY=1 LEDGER_URL_CONFIG=http://test.bcovrin.vonx.io TAILS_SERVER_URL_CONFIG=https://tails.vonx.io ./manage run -d acapy-main -t @critical -t ~@wip -t ~@T004-RFC0211 -t ~@DidMethod_orb -t ~@Transport_NoHttpOutbound
- name: Run Release or Nightly Interop Tests
if: (steps.check_if_release.outputs.is_release != 'true' && github.event_name == 'pull_request')
run: |
NO_TTY=1 LEDGER_URL_CONFIG=http://test.bcovrin.vonx.io TAILS_SERVER_URL_CONFIG=https://tails.vonx.io ./manage run -d acapy-main -t @AcceptanceTest -t ~@wip -t ~@T004-RFC0211 -t ~@DidMethod_orb -t ~@Transport_NoHttpOutbound
3 changes: 3 additions & 0 deletions .github/workflows/scenario-integration-tests.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Scenario Integration Tests

on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
pull_request:
branches:
- main
Expand Down

0 comments on commit 29d2f12

Please sign in to comment.