Skip to content

Commit

Permalink
Add testing framework for three.js examples (#517)
Browse files Browse the repository at this point in the history
* Add initial files

* Get it working

* Update docs

* Just update patch file

* Update README

* CI

* Switch to npm

* Consolidate

* Whitelist files

* Narrow

* Format

* Rename format

* Use lint-staged

* working-directory

* Remove broken examples

* Update patch

* Update

* Update docs

* Remove example

* Update patch
  • Loading branch information
Methuselah96 authored Jul 4, 2023
1 parent 15e0d2d commit 0fb9482
Show file tree
Hide file tree
Showing 40 changed files with 19,504 additions and 5,449 deletions.
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

0 comments on commit 0fb9482

Please sign in to comment.