-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
227 additions
and
183 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Bundle | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
bundler: {type: string, required: true} | ||
target: {type: string, required: true} | ||
module: {type: string, required: true} | ||
|
||
test-tree-shaking-pull-request: | ||
needs: | ||
- build-and-test-pull-request | ||
name: ${{ inputs.bundler }} ${{ inputs.target }} ${{ inputs.module }} | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Setup node v20.x | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.x | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Construct cache keys | ||
run: | | ||
echo node_modules_key='["${{ runner.os }}", "node_modules", "20.x", "${{ hashFiles('package.json', 'yarn.lock') }}"]' >> $GITHUB_ENV; | ||
echo targets_key='["${{ runner.os }}", "targets", "20.x", "${{ inputs.target }}", "${{ inputs.module }}", "${{ hashFiles('package.json', 'yarn.lock', 'tsconfig.json', 'src/**/*', 'tsconfigs/**/*') }}"]' >> $GITHUB_ENV; | ||
- name: Cache targets | ||
uses: actions/cache@v4 | ||
with: | ||
key: ${{ join(fromJSON(env.targets_key), '-') }} | ||
path: targets | ||
|
||
- name: Cache node_modules | ||
uses: actions/cache@v4 | ||
with: | ||
key: ${{ join(fromJSON(env.node_modules_key), '-') }} | ||
path: node_modules | ||
|
||
- name: Test ${{ inputs.bundler }} tree-shaking | ||
env: | ||
t: "${{ inputs.target }}" | ||
m: "${{ inputs.module }}" | ||
run: | | ||
integration/make-files-to-bundle.sh | ||
if test "${t}" != ix; then | ||
yarn build ${t:+-t ${t}} ${m:+-m ${m}} | ||
fi | ||
yarn gulp bundle${t:+:${t}}${m:+:${m}}:${{ inputs.bundler }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Lint | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
lint-pull-request: | ||
name: Lint | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Setup node v20.x | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.x | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Construct cache keys | ||
run: | | ||
echo node_modules_key='["${{ runner.os }}", "node_modules", "20.x", "${{ hashFiles('package.json', 'yarn.lock') }}"]' >> $GITHUB_ENV; | ||
- name: Cache node_modules | ||
uses: actions/cache@v4 | ||
with: | ||
key: ${{ join(fromJSON(env.node_modules_key), '-') }} | ||
path: node_modules | ||
|
||
- name: Check if source or test files changed | ||
id: files_changed | ||
uses: tj-actions/changed-files@v44 | ||
with: | ||
files: | | ||
src/**/* | ||
spec/**/* | ||
- name: Lint files | ||
if: ${{ steps.files_changed.outputs.any_modified == 'true' }} | ||
run: | | ||
yarn --ignore-engines --non-interactive | ||
yarn lint:ci |
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
Oops, something went wrong.