Skip to content

Commit

Permalink
Run actions on pull requests, extract commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCyjaneK committed Jan 16, 2025
1 parent 6f6d005 commit d5e05ef
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/no_print_in_dart.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: No print statements in dart files

on:
pull_request:
branches: [main]
on: [pull_request]

jobs:
PR_test_build:
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/pr_test_build_android.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Cake Wallet Android

on: [push]
on: [pull_request]

defaults:
run:
Expand Down Expand Up @@ -33,6 +33,12 @@ jobs:
steps:
- name: Fix github actions messing up $HOME...
run: 'echo HOME=/root | sudo tee -a $GITHUB_ENV'
- name: Get the full commit message
run: |
FULL_MESSAGE="$(git log -1 --pretty=%B)"
echo "message<<EOF" >> $GITHUB_ENV
echo "$FULL_MESSAGE" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: configure git
run: |
Expand Down Expand Up @@ -279,14 +285,14 @@ jobs:
echo "APK_FILE=$apk_file" >> $GITHUB_ENV
- name: Upload artifact to slack
if: ${{ !contains(github.event.head_commit.message, 'skip slack') }}
if: ${{ !contains(env.message, 'skip slack') }}
continue-on-error: true
uses: adrey/[email protected]
with:
token: ${{ secrets.SLACK_APP_TOKEN }}
path: ${{ env.APK_FILE }}
channel: ${{ secrets.SLACK_APK_CHANNEL }}
initial_comment: ${{ github.event.head_commit.message }}
initial_comment: ${{ env.message }}

- name: cleanup
run: rm -rf build/app/outputs/flutter-apk/test-apk/
Expand Down
16 changes: 11 additions & 5 deletions .github/workflows/pr_test_build_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ jobs:
steps:
- name: Fix github actions messing up $HOME...
run: 'echo HOME=/root | sudo tee -a $GITHUB_ENV'
- name: Get the full commit message
run: |
FULL_MESSAGE="$(git log -1 --pretty=%B)"
echo "message<<EOF" >> $GITHUB_ENV
echo "$FULL_MESSAGE" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- uses: actions/checkout@v4
- name: configure git
run: |
Expand Down Expand Up @@ -227,7 +233,7 @@ jobs:
name: cakewallet_linux

- name: Prepare virtual desktop
if: ${{ contains(github.event.head_commit.message, 'run tests') }}
if: ${{ contains(env.message, 'run tests') }}
run: |
nohup Xvfb :99 -screen 0 720x1280x16 &
echo DISPLAY=:99 | sudo tee -a $GITHUB_ENV
Expand All @@ -243,28 +249,28 @@ jobs:
# isn't much in those wallets anyway, we still wouldn't like to leak it to anyone who is able to access github.

- name: Test [confirm_seeds_flow_test]
if: ${{ contains(github.event.head_commit.message, 'run tests') }}
if: ${{ contains(env.message, 'run tests') }}
timeout-minutes: 20
run: |
xmessage -timeout 30 "confirm_seeds_flow_test" &
rm -rf ~/.local/share/com.example.cake_wallet/ ~/Documents/cake_wallet/ ~/cake_wallet
exec timeout --signal=SIGKILL 900 flutter drive --driver=test_driver/integration_test.dart --target=integration_test/test_suites/confirm_seeds_flow_test.dart
- name: Test [create_wallet_flow_test]
if: ${{ contains(github.event.head_commit.message, 'run tests') }}
if: ${{ contains(env.message, 'run tests') }}
timeout-minutes: 20
run: |
xmessage -timeout 30 "create_wallet_flow_test" &
rm -rf ~/.local/share/com.example.cake_wallet/ ~/Documents/cake_wallet/ ~/cake_wallet
exec timeout --signal=SIGKILL 900 flutter drive --driver=test_driver/integration_test.dart --target=integration_test/test_suites/create_wallet_flow_test.dart
- name: Test [exchange_flow_test]
if: ${{ contains(github.event.head_commit.message, 'run tests') }}
if: ${{ contains(env.message, 'run tests') }}
timeout-minutes: 20
run: |
xmessage -timeout 30 "exchange_flow_test" &
rm -rf ~/.local/share/com.example.cake_wallet/ ~/Documents/cake_wallet/ ~/cake_wallet
exec timeout --signal=SIGKILL 900 flutter drive --driver=test_driver/integration_test.dart --target=integration_test/test_suites/exchange_flow_test.dart
- name: Test [restore_wallet_through_seeds_flow_test]
if: ${{ contains(github.event.head_commit.message, 'run tests') }}
if: ${{ contains(env.message, 'run tests') }}
timeout-minutes: 20
run: |
xmessage -timeout 30 "restore_wallet_through_seeds_flow_test" &
Expand Down

0 comments on commit d5e05ef

Please sign in to comment.