update
This commit is contained in:
33
.github/workflows/ci.yaml
vendored
33
.github/workflows/ci.yaml
vendored
@ -14,18 +14,31 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
node: [ '14', '13', '12' ]
|
||||
os: [ ubuntu-latest ]
|
||||
os: [ windows-latest, ubuntu-latest ]
|
||||
name: Test with Node v${{ matrix.node }} on ${{ matrix.os }}
|
||||
steps:
|
||||
- name: Tell if project is using npm or yarn
|
||||
id: _1
|
||||
uses: garronej/github_actions_toolkit@v1.11
|
||||
with:
|
||||
action_name: tell_if_project_uses_npm_or_yarn
|
||||
owner: ${{github.repository_owner}}
|
||||
repo: ${{github.event.repository.name}}
|
||||
branch: ${{github.ref}}
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
- run: npm ci
|
||||
- run: npm run build
|
||||
- run: npm run test
|
||||
|
||||
|
||||
- if: steps._1.npm_or_yarn == 'yarn'
|
||||
run: |
|
||||
yarn install --frozen-lockfile
|
||||
yarn run build
|
||||
yarn run test
|
||||
- if: steps._1.npm_or_yarn == 'npm'
|
||||
run: |
|
||||
npm ci
|
||||
npm run build
|
||||
npm run test
|
||||
trigger_publish:
|
||||
name: Trigger publish.yaml workflow if package.json version updated ( and secrets.PAT is set ).
|
||||
runs-on: ubuntu-latest
|
||||
@ -37,7 +50,7 @@ jobs:
|
||||
|
||||
- name: Get version on latest
|
||||
id: v_latest
|
||||
uses: garronej/github_actions_toolkit@v1.9
|
||||
uses: garronej/github_actions_toolkit@v1.11
|
||||
with:
|
||||
action_name: get_package_json_version
|
||||
owner: ${{github.repository_owner}}
|
||||
@ -47,7 +60,7 @@ jobs:
|
||||
|
||||
- name: Get version on develop
|
||||
id: v_develop
|
||||
uses: garronej/github_actions_toolkit@v1.9
|
||||
uses: garronej/github_actions_toolkit@v1.11
|
||||
with:
|
||||
action_name: get_package_json_version
|
||||
owner: ${{github.repository_owner}}
|
||||
@ -57,7 +70,7 @@ jobs:
|
||||
|
||||
- name: 'Trigger the ''publish'' workflow'
|
||||
if: ${{ !!env.PAT && steps.v_develop.outputs.compare_result == '1' }}
|
||||
uses: garronej/github_actions_toolkit@v1.9
|
||||
uses: garronej/github_actions_toolkit@v1.11
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.PAT }}
|
||||
with:
|
||||
@ -73,4 +86,4 @@ jobs:
|
||||
steps.v_develop.outputs.version,
|
||||
github.event.repository.name
|
||||
)
|
||||
}}
|
||||
}}
|
Reference in New Issue
Block a user