mirror of
https://github.com/garronej/ts-ci.git
synced 2025-11-30 21:43:05 +00:00
Commit to using only yarn
This commit is contained in:
parent
fe7c64db2c
commit
5b3860719a
2 changed files with 8 additions and 27 deletions
33
.github/workflows/ci.yaml
vendored
33
.github/workflows/ci.yaml
vendored
|
|
@ -16,14 +16,10 @@ jobs:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
- uses: bahmutov/npm-install@v1
|
- uses: bahmutov/npm-install@v1
|
||||||
- name: If this step fails run 'npm run lint' and 'npm run format' then commit again.
|
- name: If this step fails run 'yarn lint' and 'yarn format' then commit again.
|
||||||
run: |
|
run: |
|
||||||
PACKAGE_MANAGER=npm
|
yarn lint:check
|
||||||
if [ -f "./yarn.lock" ]; then
|
yarn format:check
|
||||||
PACKAGE_MANAGER=yarn
|
|
||||||
fi
|
|
||||||
$PACKAGE_MANAGER run lint:check
|
|
||||||
$PACKAGE_MANAGER run format:check
|
|
||||||
test:
|
test:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
needs: test_lint
|
needs: test_lint
|
||||||
|
|
@ -33,24 +29,14 @@ jobs:
|
||||||
os: [ windows-latest, ubuntu-latest ]
|
os: [ windows-latest, ubuntu-latest ]
|
||||||
name: Test with Node v${{ matrix.node }} on ${{ matrix.os }}
|
name: Test with Node v${{ matrix.node }} on ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Tell if project is using npm or yarn
|
|
||||||
id: step1
|
|
||||||
uses: garronej/ts-ci@v2.0.2
|
|
||||||
with:
|
|
||||||
action_name: tell_if_project_uses_npm_or_yarn
|
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node }}
|
node-version: ${{ matrix.node }}
|
||||||
- uses: bahmutov/npm-install@v1
|
- uses: bahmutov/npm-install@v1
|
||||||
- if: steps.step1.outputs.npm_or_yarn == 'yarn'
|
- run: yarn build
|
||||||
run: |
|
- run: yarn test
|
||||||
yarn build
|
|
||||||
yarn test
|
|
||||||
- if: steps.step1.outputs.npm_or_yarn == 'npm'
|
|
||||||
run: |
|
|
||||||
npm run build
|
|
||||||
npm test
|
|
||||||
check_if_version_upgraded:
|
check_if_version_upgraded:
|
||||||
name: Check if version upgrade
|
name: Check if version upgrade
|
||||||
# We run this only if it's a push on the default branch or if it's a PR from a
|
# We run this only if it's a push on the default branch or if it's a PR from a
|
||||||
|
|
@ -110,12 +96,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
registry-url: https://registry.npmjs.org/
|
registry-url: https://registry.npmjs.org/
|
||||||
- uses: bahmutov/npm-install@v1
|
- uses: bahmutov/npm-install@v1
|
||||||
- run: |
|
- run: yarn build
|
||||||
PACKAGE_MANAGER=npm
|
|
||||||
if [ -f "./yarn.lock" ]; then
|
|
||||||
PACKAGE_MANAGER=yarn
|
|
||||||
fi
|
|
||||||
$PACKAGE_MANAGER run build
|
|
||||||
- run: npx -y -p denoify@1.2.2 enable_short_npm_import_path
|
- run: npx -y -p denoify@1.2.2 enable_short_npm_import_path
|
||||||
env:
|
env:
|
||||||
DRY_RUN: "0"
|
DRY_RUN: "0"
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ Besides, good stuff that comes with using this template:
|
||||||
|
|
||||||
## Can I use `npm` instead of `yarn`
|
## Can I use `npm` instead of `yarn`
|
||||||
|
|
||||||
Yes, just remove the `yarn.lock` file.
|
Yes, just remove the `yarn.lock` file and edit `.github/workflows/ci.yaml`, replace all `yarn ***` by `npm run ****`.
|
||||||
## What will be included in the npm bundle?
|
## What will be included in the npm bundle?
|
||||||
|
|
||||||
All filles listed in [the files property of your package JSON](https://github.com/garronej/ts_ci/blob/974054f2b83f8170317f2b2fa60b5f78e9336c0b/package.json#L35-L41).
|
All filles listed in [the files property of your package JSON](https://github.com/garronej/ts_ci/blob/974054f2b83f8170317f2b2fa60b5f78e9336c0b/package.json#L35-L41).
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue