Skip to content
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

Add testing framework for three.js examples #517

Merged
merged 20 commits into from
Jul 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
35 changes: 26 additions & 9 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,34 @@ on:
jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'yarn'

# Get local dependencies
- run: yarn install

# Run tests
- run: yarn run prettier:check
- run: yarn run test-all
cache: 'npm'
- run: npm ci
- run: npm run test-all
check-fomatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'npm'
- run: npm ci
- run: npm run format-check
test-examples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'npm'
- run: npm ci
- run: git apply changes.patch
working-directory: examples-testing
- run: npm run type-check
working-directory: examples-testing
7 changes: 3 additions & 4 deletions .husky/pre-commit
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn pretty-quick pretty-quick
yarn prettier:check
npx lint-staged
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.pnp.*
.yarn/*
examples-testing/examples
873 changes: 0 additions & 873 deletions .yarn/releases/yarn-3.5.1.cjs

This file was deleted.

2 changes: 0 additions & 2 deletions .yarnrc.yml

This file was deleted.

4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Thanks for wanting to make a contribution and wanting to improve this library fo
## Project setup

1. Fork and clone the repo
2. Run `yarn install` to install dependencies
2. Run `npm install` to install dependencies
3. Create a branch for your PR with `git checkout -b pr-type/issue-number-your-branch-name`
4. Let's get cooking! 👨🏻‍🍳🥓

Expand All @@ -18,7 +18,7 @@ Be sure your commit messages follow this specification: https://www.conventional
This project follows the [all contributors](https://github.com/kentcdodds/all-contributors) specification. To add yourself to the table of contributors on the `README.md`, please use the automated script as part of your PR:

```console
yarn contributors:add
npm run contributors:add
```

Follow the prompt and commit `.all-contributorsrc` and `README.md` in the PR. If you've already added yourself to the list and are making a new type of contribution, you can run it again and select the added contribution type.
Expand Down
21 changes: 21 additions & 0 deletions examples-testing/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Update patch

- `git apply changes.patch`
- Make changes
- `yarn run type-check`
- `git diff > ../changes.patch`
- Reset changes
- Move patch file

# Update sources

- Delete all examples
- `node index.js`
- Commit changes
- `git apply --reject changes.patch`
- Fix conflicts
- `yarn run type-check`
- `git diff > ../changes.patch`
- Reset changes
- Move patch file
- Commit changes
Loading