2022-02-17 14:52:46 +00:00
|
|
|
name: 'pr-platform'
|
|
|
|
on:
|
2023-07-08 20:03:14 +00:00
|
|
|
push:
|
|
|
|
branches: master
|
2022-02-17 14:52:46 +00:00
|
|
|
workflow_dispatch:
|
|
|
|
pull_request:
|
2023-06-21 20:54:14 +00:00
|
|
|
types:
|
|
|
|
- labeled
|
|
|
|
- opened
|
2023-07-08 20:03:14 +00:00
|
|
|
schedule:
|
|
|
|
- cron: '0 0 * * *'
|
2022-02-17 14:52:46 +00:00
|
|
|
jobs:
|
2023-06-21 20:54:14 +00:00
|
|
|
pr-platform:
|
2023-07-08 20:03:14 +00:00
|
|
|
if: contains(github.event.pull_request.labels.*.name, 'pr:platform') || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
|
2022-02-17 14:52:46 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
2023-06-21 20:54:14 +00:00
|
|
|
timeout-minutes: 60
|
2022-02-17 14:52:46 +00:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
os:
|
|
|
|
- ubuntu-latest
|
|
|
|
- macos-latest
|
|
|
|
- windows-latest
|
|
|
|
node_version:
|
2023-06-21 20:54:14 +00:00
|
|
|
- lts/gallium
|
|
|
|
- lts/hydrogen
|
2022-02-17 14:52:46 +00:00
|
|
|
architecture:
|
|
|
|
- x64
|
2023-08-30 23:12:06 +00:00
|
|
|
|
2022-02-17 14:52:46 +00:00
|
|
|
name: Node ${{ matrix.node_version }} - ${{ matrix.architecture }} on ${{ matrix.os }}
|
|
|
|
steps:
|
2023-11-02 23:39:54 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-08-30 23:12:06 +00:00
|
|
|
|
2022-02-17 14:52:46 +00:00
|
|
|
- name: Setup node
|
2023-10-24 23:52:17 +00:00
|
|
|
uses: actions/setup-node@v4
|
2022-02-17 14:52:46 +00:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node_version }}
|
|
|
|
architecture: ${{ matrix.architecture }}
|
2023-06-21 20:54:14 +00:00
|
|
|
|
|
|
|
- name: Cache NPM dependencies
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
|
|
|
path: ~/.npm
|
|
|
|
key: ${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('**/package.json') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-${{ matrix.node_version }}-
|
|
|
|
|
2023-08-08 17:44:16 +00:00
|
|
|
- run: npm install --cache ~/.npm --no-audit --progress=false
|
2023-08-30 23:12:06 +00:00
|
|
|
|
2022-02-17 14:52:46 +00:00
|
|
|
- run: npm test
|
2023-08-30 23:12:06 +00:00
|
|
|
|
2022-03-03 22:07:54 +00:00
|
|
|
- run: npm run lint -- --quiet
|
2023-08-30 23:12:06 +00:00
|
|
|
|
2023-06-21 20:54:14 +00:00
|
|
|
- name: Remove pr:platform label (if present)
|
|
|
|
if: always()
|
|
|
|
uses: actions/github-script@v6
|
|
|
|
with:
|
|
|
|
script: |
|
|
|
|
const { owner, repo, number } = context.issue;
|
|
|
|
const labelToRemove = 'pr:platform';
|
|
|
|
try {
|
|
|
|
await github.rest.issues.removeLabel({
|
|
|
|
owner,
|
|
|
|
repo,
|
|
|
|
issue_number: number,
|
|
|
|
name: labelToRemove
|
|
|
|
});
|
|
|
|
} catch (error) {
|
|
|
|
core.warning(`Failed to remove ' + labelToRemove + ' label: ${error.message}`);
|
|
|
|
}
|