ci: hey #7947
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build & Test CI | ||
on: | ||
push: | ||
workflow_call: | ||
secrets: | ||
CHROMATIC_PROJECT_TOKEN: | ||
required: true | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup node π» | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.node-version' | ||
cache: 'yarn' | ||
- name: Install Dependencies β¬οΈ | ||
run: yarn install --immutable | ||
- name: Type check π | ||
run: yarn run types | ||
- name: Run CI Tests β | ||
run: yarn run test:ci | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
CI: true | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup node π» | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.node-version' | ||
cache: 'yarn' | ||
- name: Install Dependencies β¬οΈ | ||
run: yarn install --immutable | ||
- name: Build Dist π§ | ||
run: yarn run build | ||
# Rollup's TS plugin can include an implicit dependency on tslib that we don't want. It shouldn't be | ||
# included in builds if our tsconfig.json configures "target" properly, which this check ensures. | ||
- name: Check for "tslib" in build | ||
run: | | ||
if grep -r '--include=*.'{cjs,js} 'tslib' ./lib -q | ||
then | ||
echo "tslib found in lib" | ||
exit 1 | ||
fi | ||
storybook: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # π Required to retrieve git history | ||
- name: Install dependencies | ||
run: yarn install --immutable | ||
- name: Build design tokens | ||
run: yarn build:tokens | ||
- name: Build Storybook π | ||
run: yarn build:storybook --webpack-stats-json | ||
- name: Publish to Chromatic π¦ | ||
run: | | ||
yarn run chromatic \ | ||
--project-token=${{ secrets.CHROMATIC_PROJECT_TOKEN }} \ | ||
--storybook-build-dir storybook-static \ | ||
--exit-zero-on-changes \ | ||
--exit-once-uploaded \ | ||
--auto-accept-changes '{main,next}' \ | ||
--only-changed \ | ||
--skip 'dependabot/**' | ||
- name: Run Accessibility Tests π | ||
run: yarn run storybook:axeOnly | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup node π» | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.node-version' | ||
cache: 'yarn' | ||
- name: Install Dependencies π§Ά | ||
run: yarn install --immutable | ||
# required since there are references to built tokens | ||
- name: Build design tokens π οΈ | ||
run: yarn build:tokens | ||
- name: Lint Javascript + SCSS π | ||
run: yarn run lint --max-warnings=0 | ||
commitlint: | ||
name: Lint Commit Messages π | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup node π» | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: '.node-version' | ||
cache: 'yarn' | ||
- name: Install Dependencies π§Ά | ||
run: yarn install --immutable | ||
- name: Validate current commit (last commit) with commitlint | ||
if: github.event_name == 'pull_request' | github.event_name == 'pull_request_target' | ||
Check failure on line 124 in .github/workflows/test.yml
|
||
run: | | ||
npx commitlint --from HEAD~${{ github.event.commits }} --to HEAD --verbose | ||
- name: Validate current commit (last commit) with commitlint | ||
if: github.event_name == 'push' | ||
run: | | ||
npx commitlint --from ${{ github.event.before }} --to ${{ github.event.after }} --verbose | ||
# - name: Validate PR commits with commitlint | ||
# if: github.event_name == 'pull_request' | ||
# run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose | ||
# - name: Validate pushed commits with commitlint | ||
# # This workflow can also be triggered via "workflow_call" which won't be a push_event | ||
# # Since it's a push event we have access to these properties https://docs.github.com/en/webhooks/webhook-events-and-payloads#push | ||
# if: github.event_name == 'push' | ||
# run: | | ||
# yarn commitlint --from ${{ github.event.before }} --to ${{ github.event.after }} --verbose | ||
#two paths, if it has commits | ||
# if it has commits |