Skip to content

Commit

Permalink
Adding optimizations to ci tests (#131)
Browse files Browse the repository at this point in the history
  • Loading branch information
BobaFetters authored and gh-action-runner committed Nov 8, 2023
1 parent f231558 commit 1755ce3
Showing 1 changed file with 29 additions and 4 deletions.
33 changes: 29 additions & 4 deletions .github/workflows/ci-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,36 @@ jobs:
changes:
runs-on: ubuntu-latest
outputs:
ios: ${{ steps.filter.outputs.ios }}
codegen: ${{ steps.filter.outputs.codegen }}
pagination: ${{ steps.filter.outputs.pagination }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
ios:
- 'apollo-ios/**'
- 'Tests/ApolloInternalTestHelpers/**'
- 'Tests/ApolloServerIntegrationTests/**'
- 'Tests/ApolloTests/**'
codegen:
- 'apollo-ios-codegen/**'
- 'Tests/ApolloCodegenInternalTestHelpers/**'
- 'Tests/ApolloCodegenTests/**'
- 'Tests/CodegenCLITests/**'
- 'Tests/CodegenIntegrationTests/**'
- 'Tests/TestCodeGenConfigurations/**'
pagination:
- 'apollo-ios-pagination/**'
- 'Tests/ApolloInternalTestHelpers/**'
- 'apollo-ios/**'
tuist-generation:
runs-on: macos-13
needs: [changes]
if: ${{ needs.changes.outputs.ios == 'true' || needs.changes.outputs.codegen == 'true' || needs.changes.outputs.pagination == 'true' }}
timeout-minutes: 8
name: Run Tuist Generation
steps:
Expand Down Expand Up @@ -82,21 +99,21 @@ jobs:
test-plan: Apollo-CITestPlan
name: Apollo Unit Tests - macOS
run-js-tests: false
should-run: true
should-run: ${{ needs.changes.outputs.ios }}
# Codegen CLI Test
- destination: platform=macOS,arch=x86_64
scheme: CodegenCLITests
test-plan: CodegenCLITestPlan
name: Codegen CLI Unit Tests - macOS
run-js-tests: false
should-run: true
should-run: ${{ needs.changes.outputs.codegen }}
# CodegenLib Test
- destination: platform=macOS,arch=x86_64
scheme: ApolloCodegenTests
test-plan: Apollo-Codegen-CITestPlan
name: Codegen Lib Unit Tests - macOS
run-js-tests: true
should-run: true
should-run: ${{ needs.changes.outputs.codegen }}
# ApolloPagination Tests
- destination: platform=macOS,arch=x86_64
scheme: ApolloPaginationTests
Expand Down Expand Up @@ -132,6 +149,7 @@ jobs:
# arguments: ''
- name: Build and Test
if: ${{ matrix.should-run == true || matrix.should-run == 'true' }}
id: build-and-test
uses: ./.github/actions/build-and-run-unit-tests
with:
destination: ${{ matrix.destination }}
Expand All @@ -144,23 +162,27 @@ jobs:
run: |
npm install && npm test
- name: Save xcodebuild logs
if: ${{ steps.build-and-test.outcome != 'skipped' }}
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.name }}-logs
path: |
DerivedData/Logs/Build
- name: Save crash logs
if: ${{ steps.build-and-test.outcome != 'skipped' }}
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.name }}-crashes
path: |
~/Library/Logs/DiagnosticReports
- name: Zip Result Bundle
if: ${{ steps.build-and-test.outcome != 'skipped' }}
shell: bash
working-directory: TestResults
run: |
zip -r ResultBundle.zip ResultBundle.xcresult
- name: Save test results
if: ${{ steps.build-and-test.outcome != 'skipped' }}
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.name }}-results
Expand All @@ -169,6 +191,8 @@ jobs:
run-codegen-test-configurations:
runs-on: macos-13
needs: [changes]
if: ${{ needs.changes.outputs.codegen == 'true' }}
timeout-minutes: 20
name: Codegen Test Configurations - macOS
steps:
Expand Down Expand Up @@ -208,7 +232,8 @@ jobs:

run-integration-tests:
runs-on: macos-13
needs: tuist-generation
needs: [tuist-generation, changes]
if: ${{ needs.changes.outputs.ios == 'true' }}
timeout-minutes: 20
name: Apollo Integration Tests - macOS
steps:
Expand Down

0 comments on commit 1755ce3

Please sign in to comment.