Skip to content

Commit d4f1d0b

Browse files
authored
Refactor workflows to run tests on PRs (#89)
1 parent 0cc558a commit d4f1d0b

File tree

5 files changed

+32
-12
lines changed

5 files changed

+32
-12
lines changed

.github/workflows/charts_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
defaults:
1212
run:
1313
working-directory: ./chart_data_extractor
14-
name: Build and test Chart Data Extractor
14+
name: Chart Data Extractor - Build and test
1515
runs-on: ubuntu-22.04
1616
steps:
1717
- name: Checkout repository

.github/workflows/js_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
defaults:
1515
run:
1616
working-directory: ./js
17-
name: Build and test SDK
17+
name: JS SDK - Build and test
1818
runs-on: ubuntu-22.04
1919
steps:
2020
- name: Checkout repository

.github/workflows/pull_request.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Pull Request
2+
3+
permissions:
4+
contents: read
5+
id-token: write
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: true
10+
11+
on:
12+
pull_request:
13+
branches:
14+
- main
15+
16+
jobs:
17+
js-sdk:
18+
uses: ./.github/workflows/js_tests.yml
19+
secrets:
20+
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
21+
python-sdk:
22+
uses: ./.github/workflows/python_tests.yml
23+
secrets:
24+
E2B_API_KEY: ${{ secrets.E2B_API_KEY }}
25+
charts-tests:
26+
uses: ./.github/workflows/charts_tests.yml

.github/workflows/python_tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
defaults:
1515
run:
1616
working-directory: ./python
17-
name: Build and test SDK
17+
name: Python SDK - Build and test
1818
runs-on: ubuntu-22.04
1919
steps:
2020
- name: Checkout repository

.github/workflows/release.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,9 @@ jobs:
108108
IS_RELEASE=$(./.github/scripts/is_release_for_package.sh "@e2b/code-interpreter-template")
109109
echo "release=$IS_RELEASE" >> "$GITHUB_OUTPUT"
110110
111-
charts-tests:
112-
name: Charts tests
113-
needs: [changes]
114-
if: needs.changes.outputs.charts == 'true'
115-
uses: ./.github/workflows/charts_tests.yml
116111
117112
charts-release:
118113
name: Charts release
119-
needs: [charts-tests]
120114
if: needs.changes.outputs.charts == 'true'
121115
runs-on: ubuntu-latest
122116
outputs:
@@ -243,8 +237,8 @@ jobs:
243237
needs: [changes, build-template]
244238
if: always() &&
245239
!contains(needs.*.result, 'failure') &&
246-
!contains(needs.*.result, 'cancelled') &&
247-
(needs.changes.outputs.python == 'true' || needs.changes.outputs.template == 'true')
240+
!contains(needs.*.result, 'cancelled') &&
241+
needs.changes.outputs.template == 'true'
248242
uses: ./.github/workflows/python_tests.yml
249243
secrets: inherit
250244

@@ -254,7 +248,7 @@ jobs:
254248
if: always() &&
255249
!contains(needs.*.result, 'failure') &&
256250
!contains(needs.*.result, 'cancelled') &&
257-
(needs.changes.outputs.js == 'true' || needs.changes.outputs.template == 'true')
251+
needs.changes.outputs.template == 'true'
258252
uses: ./.github/workflows/js_tests.yml
259253
secrets: inherit
260254

0 commit comments

Comments
 (0)