Skip to content

Commit

Permalink
github: trigger lit CI for current branch
Browse files Browse the repository at this point in the history
  • Loading branch information
ellemouton committed Aug 28, 2024
1 parent 30e7166 commit 77dabe7
Showing 1 changed file with 64 additions and 2 deletions.
66 changes: 64 additions & 2 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -291,12 +291,74 @@ jobs:
path: logs-itest-postgres.zip
retention-days: 5

# Notify about the completion of all coverage collecting jobs.
########################
# Trigger LiTd integration tests
########################
trigger-lit-ci:
name: trigger LiT itests
runs-on: ubuntu-latest

steps:
- name: git checkout
uses: actions/checkout@v3

- name: Setup go environment
uses: ./.github/actions/setup-go

- name: Get current Tap commit hash and branch name
run: |
echo "TAP_COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV
echo "TAP_BRANCH=${GITHUB_REF_NAME}" >> $GITHUB_ENV
- name: Clone Lit repository
run: |
git clone https://github.com/lightninglabs/lightning-terminal.git
cd lightning-terminal
git config user.name "github-actions"
git config user.email "[email protected]"
- name: Update go.mod to use the local Tap repository
run: |
cd lightning-terminal
go mod edit -replace=github.com/lightning-labs/taproot-assets=../
go mod tidy
- name: Push changes to a temporary branch in Lit
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd lightning-terminal
git checkout -b tap-${{ env.TAP_BRANCH }}
git commit -am "Update Tap dependency for branch ${{ env.TAP_BRANCH }}"
git remote set-url origin https://github-actions:${GITHUB_TOKEN}@github.com/lightninglabs/lightning-terminal.git
git push origin tap-${{ env.TAP_BRANCH }}
# git remote set-url origin [email protected]:lightninglabs/lightning-terminal.git
- name: Trigger Lit CI via GitHub API
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
https://api.github.com/repos/lightninglabs/lightning-terminal/actions/workflows/main.yml/dispatches \
-d '{"ref":"tap-${{ env.TAP_BRANCH }}"}'
- name: Cleanup temporary branch in Lit
if: success()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -X DELETE \
-H "Authorization: Bearer $GITHUB_TOKEN" \
https://api.github.com/repos/lightninglabs/lightning-terminal/git/refs/heads/tap-${{ env.TAP_BRANCH }}
# Notify about the completion of all coverage collecting jobs.
finish:
if: ${{ always() }}
needs: [unit-test]
runs-on: ubuntu-latest
steps:
- uses: shogo82148/actions-goveralls@v1
with:
parallel-finished: true
parallel-finished: true

0 comments on commit 77dabe7

Please sign in to comment.