-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
github: trigger lit CI for current branch
- Loading branch information
1 parent
30e7166
commit 77dabe7
Showing
1 changed file
with
64 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 |