103 lines
2.8 KiB
YAML
103 lines
2.8 KiB
YAML
name: "build-test"
|
|
on: # rebuild any PRs and main branch changes
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build: # make sure build/ci work properly
|
|
strategy:
|
|
matrix:
|
|
node: [20]
|
|
os: [ ubuntu-latest, macos-latest ]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ matrix.node }}
|
|
- run: |
|
|
npm ci
|
|
npm run all
|
|
- uses: coverallsapp/github-action@master
|
|
with:
|
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
build-on-windows:
|
|
strategy:
|
|
matrix:
|
|
node: [20]
|
|
runs-on: windows-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ matrix.node }}
|
|
# https://stackoverflow.com/questions/72401421/message-npm-warn-config-global-global-local-are-deprecated-use-loc
|
|
- run: |
|
|
npm install npm-windows-upgrade --location=global
|
|
npm-windows-upgrade --npm-version latest
|
|
- run: |
|
|
npm ci
|
|
npm run all
|
|
|
|
test: # make sure the action works on a clean machine without building
|
|
strategy:
|
|
matrix:
|
|
node: [20]
|
|
os: [ ubuntu-latest, macos-latest ]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
- name: Dump GitHub context
|
|
env:
|
|
GITHUB_CONTEXT: ${{ toJson(github) }}
|
|
run: echo "$GITHUB_CONTEXT"
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ matrix.node }}
|
|
- uses: ./
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
issue_title: npm audit run by test job
|
|
create_issues: false
|
|
production_flag: true
|
|
- uses: ./
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
working_directory: __tests__/testdata/workdir/
|
|
create_issues: false
|
|
production_flag: true
|
|
|
|
test-on-windows:
|
|
strategy:
|
|
matrix:
|
|
node: [20]
|
|
runs-on: windows-latest
|
|
steps:
|
|
- name: Dump GitHub context
|
|
env:
|
|
GITHUB_CONTEXT: ${{ toJson(github) }}
|
|
run: echo "$GITHUB_CONTEXT"
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: ${{ matrix.node }}
|
|
# https://stackoverflow.com/questions/72401421/message-npm-warn-config-global-global-local-are-deprecated-use-loc
|
|
- run: |
|
|
npm install npm-windows-upgrade --location=global
|
|
npm-windows-upgrade --npm-version latest
|
|
- uses: ./
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
issue_title: npm audit run by test job
|
|
create_issues: false
|
|
production_flag: true
|
|
- uses: ./
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
working_directory: __tests__/testdata/workdir/
|
|
create_issues: false
|
|
production_flag: true
|