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 build steps to workflow #665

Merged
merged 11 commits into from
Aug 14, 2023
50 changes: 48 additions & 2 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ on:
- '**/*.md'

jobs:
build-lint-test:
lint-test:
runs-on: ${{ matrix.os }}
name: Build and Verify
name: Lint and Test on ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
Expand All @@ -39,3 +39,49 @@ jobs:

- name: Run unit tests
run: yarn test-unit

build:
runs-on: ${{ matrix.os }}
name: Build on ${{ matrix.os }}
needs: lint-test
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'

- name: Setup Yarn
run: |
npm uninstall -g yarn
npm i -g [email protected]
yarn install --frozen-lockfile

- name: Path filter
uses: dorny/paths-filter@v2
id: filter
with:
filters: |
src:
- 'src/**'
- package.json
- yarn.lock
docs:
- 'src-docs/**'
- package.json
- yarn.lock
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To reviewers: should other related build files be added here? Ex. postcss.config.js, tsconfig.json, ...

Copy link
Member

Choose a reason for hiding this comment

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

yeah, I think adding those is a good idea. It's hard to know whether an allowlist or a denylist is easier in this case.


- name: Build
if: steps.filter.outputs.src == 'true'
run: yarn build

- name: Build Docs
if: steps.filter.outputs.docs == 'true'
run: yarn build-docs