Skip to content

Commit

Permalink
Merge branch 'main' into s-formula
Browse files Browse the repository at this point in the history
  • Loading branch information
joshsunshine committed Jan 10, 2022
2 parents fb96cba + b697a80 commit 3083bc8
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 62 deletions.
2 changes: 0 additions & 2 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ Include a high-level summary of the implementation strategy and list important d

- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] My changes generate no new warnings
- [ ] New and existing tests pass locally using `yarn test`
- [ ] I ran `yarn docs` and there were no errors when generating the HTML site
- [ ] My code follows the style guidelines of this project (e.g.: no ESLint warnings)

# Open questions
Expand Down
16 changes: 16 additions & 0 deletions .github/actions/packages/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Setup
runs:
using: composite
steps:
- name: Restore lerna cache
id: cache
uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- if: steps.cache.outputs.cache-hit != 'true'
name: Install packages
run: yarn
shell: bash
116 changes: 56 additions & 60 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,46 +15,10 @@ jobs:
with:
# https://github.com/lerna/lerna/issues/1893#issuecomment-770614785
fetch-depth: 0
- name: Restore lerna cache
uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Install deps
run: yarn
- name: Install packages
uses: ./.github/actions/packages
- name: Run all builds
run: yarn build
- name: Run all tests
run: yarn test
- name: Make test report dir
run: mkdir -p reports/junit
working-directory: packages/core
- name: Run core tests and generate test data
run: yarn coverage --ci --runInBand --reporters=default --reporters=jest-junit
working-directory: packages/core
- name: Move test report
run: mv junit.xml reports/junit/
working-directory: packages/core
- name: Upload test coverage to codecov
run: bash <(curl -s https://codecov.io/bash)
working-directory: packages/core
# TODO: some equivalent of CircleCI's store_test_results
# with path: packages/core/reports/junit/
- name: Upload all working example diagrams generated by the test suite
uses: actions/upload-artifact@v2
with:
name: diagrams
path: /tmp/diagrams/
- uses: actions/upload-artifact@v2
with:
name: junit
path: packages/core/reports/junit/
- uses: actions/upload-artifact@v2
with:
name: coverage
path: packages/core/coverage
- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
name: Authenticate with registry
run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
Expand All @@ -66,28 +30,21 @@ jobs:

storybook:
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
defaults:
run:
working-directory: ./packages/components
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Restore lerna cache
uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Install packages
run: yarn
uses: ./.github/actions/packages
- name: Build core
run: yarn build
working-directory: ./packages/core
- name: Build storybook
run: yarn build-storybook
- name: Deploy docs
- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
name: Deploy docs
uses: JamesIves/github-pages-deploy-action@4.1.4
with:
branch: gh-pages
Expand All @@ -97,34 +54,72 @@ jobs:
run: |
mkdir extra
touch extra/.nojekyll
- name: Deploy .nojekyll
- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
name: Deploy .nojekyll
uses: JamesIves/github-pages-deploy-action@4.1.4
with:
branch: gh-pages
folder: packages/components/extra
clean: false

typedocs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install packages
uses: ./.github/actions/packages
- name: Run all tests
run: yarn test

test-core:
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
defaults:
run:
working-directory: ./packages/core
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Restore lerna cache
uses: actions/cache@v2
- name: Install packages
uses: ./.github/actions/packages
- name: Make test report dir
run: mkdir -p reports/junit
- name: Run core tests and generate test data
run: yarn coverage --ci --runInBand --reporters=default --reporters=jest-junit
- name: Move test report
run: mv junit.xml reports/junit/
- name: Upload test coverage to codecov
run: bash <(curl -s https://codecov.io/bash)
# TODO: some equivalent of CircleCI's store_test_results
# with path: packages/core/reports/junit/
- name: Upload all working example diagrams generated by the test suite
uses: actions/upload-artifact@v2
with:
name: diagrams
path: /tmp/diagrams/
- uses: actions/upload-artifact@v2
with:
name: junit
path: packages/core/reports/junit/
- uses: actions/upload-artifact@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
name: coverage
path: packages/core/coverage

typedocs:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./packages/core
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install packages
run: yarn
uses: ./.github/actions/packages
- name: Build docs
run: yarn docs
- name: Deploy docs
- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
name: Deploy docs
uses: JamesIves/github-pages-deploy-action@4.1.4
with:
branch: gh-pages
Expand All @@ -134,7 +129,8 @@ jobs:
run: |
mkdir extra
touch extra/.nojekyll
- name: Deploy .nojekyll
- if: github.event_name == 'push' && github.ref == 'refs/heads/main'
name: Deploy .nojekyll
uses: JamesIves/github-pages-deploy-action@4.1.4
with:
branch: gh-pages
Expand Down

0 comments on commit 3083bc8

Please sign in to comment.