Skip to content

chore: Update CircleCI to run examples #557

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 30, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,15 @@ jobs:
at: ~/react-native-testing-library
- run: |
cd website && yarn install && yarn build
test-examples:
<<: *defaults
steps:
- attach_workspace:
at: ~/react-native-testing-library
- run: |
cd examples/reactnavigation && yarn install && yarn test
- run: |
cd examples/redux && yarn install && yarn test
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we have a "for-each" that would go through all examples?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ls -d ./examples/* | xargs -I {} bash -c "cd '{}' && npm install && npm run test"

This lists all directory inside the examples directory and for each of them, installs dependencies and runs a test

deploy-website:
<<: *defaults
steps:
Expand Down Expand Up @@ -96,6 +105,10 @@ workflows:
- install-dependencies
# docusuarus build is running when deploying website as well
filters: *filter-ignore-master
- test-examples:
requires:
- install-dependencies
filters: *filter-only-master
- deploy-website:
requires:
- install-dependencies
Expand Down