Skip to content

Commit b79b970

Browse files
committed
Only running sim/emu tests if there are changes made to common or powersync-op-sqlite.
1 parent 4ca417c commit b79b970

1 file changed

Lines changed: 23 additions & 9 deletions

File tree

.github/workflows/test-simulators.yaml

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,29 @@ on:
44
pull_request: # triggered for any PR updates (including new pushes to PR branch)
55

66
jobs:
7+
check-changes:
8+
name: Check for relevant changes
9+
runs-on: ubuntu-latest
10+
outputs:
11+
should_run: ${{ steps.check.outputs.should_run }}
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
- name: Check for changes
17+
id: check
18+
run: |
19+
git fetch origin ${{ github.base_ref }}
20+
if git diff --quiet origin/${{ github.base_ref }} -- packages/common packages/powersync-op-sqlite; then
21+
echo "should_run=false" >> $GITHUB_OUTPUT
22+
else
23+
echo "should_run=true" >> $GITHUB_OUTPUT
24+
fi
25+
726
test-android:
827
name: Test Android
28+
needs: check-changes
29+
if: ${{ needs.check-changes.outputs.should_run == 'true' }}
930
runs-on: ubuntu-xl
1031
env:
1132
AVD_NAME: ubuntu-avd-x86_64-31
@@ -108,6 +129,8 @@ jobs:
108129

109130
test-ios:
110131
name: Test iOS
132+
needs: check-changes
133+
if: ${{ needs.check-changes.outputs.should_run == 'true' }}
111134
runs-on: macOS-15
112135

113136
steps:
@@ -147,15 +170,6 @@ jobs:
147170
restore-keys: |
148171
${{ runner.os }}-pnpm-store-
149172
150-
- name: Cache Xcode Derived Data
151-
uses: actions/cache@v3
152-
with:
153-
path: |
154-
DerivedData
155-
key: xcode-derived-${{ runner.os }}-${{ hashFiles('tools/powersynctests/ios/Podfile.lock') }}
156-
restore-keys: |
157-
xcode-derived-${{ runner.os }}-
158-
159173
- name: Install dependencies
160174
run: pnpm install
161175

0 commit comments

Comments
 (0)