Browse Source

ci: update workflows to use bun and node 20

pull/11504/head
afc163 9 months ago
parent
commit
566a9cd201
  1. 16
      .github/workflows/ci.yml
  2. 41
      .github/workflows/codeql.yml
  3. 22
      .github/workflows/coverage.yml
  4. 33
      .github/workflows/pnpm.yml
  5. 7
      .github/workflows/preview-build.yml
  6. 6
      .github/workflows/preview-deploy.yml

16
.github/workflows/ci.yml

@ -1,4 +1,4 @@
name: Node CI
name: CI
on: [push, pull_request]
@ -10,19 +10,19 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node_version: [16.x, 14.x]
node_version: [20]
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node_version }}
- run: echo ${{github.ref}}
- run: npm install --legacy-peer-deps
- run: yarn run lint
- run: yarn run tsc
- run: yarn run build
- uses: oven-sh/setup-bun@v2
- run: bun install
- run: bun run lint
- run: bun run build
env:
CI: true
PROGRESS: none

41
.github/workflows/codeql.yml

@ -1,41 +0,0 @@
name: "CodeQL"
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
schedule:
- cron: "48 12 * * 2"
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ javascript ]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: +security-and-quality
- name: Autobuild
uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{ matrix.language }}"

22
.github/workflows/coverage.yml

@ -9,19 +9,13 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Use Node.js 16.x
uses: actions/setup-node@v1
- uses: actions/checkout@v4
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: 16.x
node-version: 20
- run: echo ${{github.ref}}
- run: curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm@7
- run: pnpm config set store-dir ~/.pnpm-store
- run: pnpm install --strict-peer-dependencies=false
- run: yarn run test:coverage
env:
CI: true
PROGRESS: none
NODE_ENV: test
NODE_OPTIONS: --max_old_space_size=4096
- run: bash <(curl -s https://codecov.io/bash)
- uses: oven-sh/setup-bun@v2
- run: bun install
- run: bun run test:coverage
- uses: codecov/codecov-action@v5

33
.github/workflows/pnpm.yml

@ -1,33 +0,0 @@
name: Node pnpm CI
on: [push, pull_request]
permissions:
contents: read
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
node_version: [16.x]
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node_version }}
- run: echo ${{github.ref}}
- run: curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm@7
- run: pnpm config set store-dir ~/.pnpm-store
- run: pnpm install --strict-peer-dependencies=false
- run: pnpm run lint
- run: pnpm run tsc
- run: pnpm run build
- run: pnpm run test
env:
CI: true
PROGRESS: none
NODE_ENV: test
NODE_OPTIONS: --max_old_space_size=4096

7
.github/workflows/preview-build.yml

@ -12,18 +12,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: build
run: |
yarn
yarn add umi-plugin-pro --save
yarn build
- name: upload dist artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: dist
path: dist/
@ -35,7 +34,7 @@ jobs:
- name: Upload PR number
if: ${{ always() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: pr
path: ./pr-id.txt

6
.github/workflows/preview-deploy.yml

@ -19,7 +19,7 @@ jobs:
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
steps:
- name: download pr artifact
uses: dawidd6/action-download-artifact@v2
uses: dawidd6/action-download-artifact@v4
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
name: pr
@ -29,7 +29,7 @@ jobs:
run: echo "::set-output name=id::$(<pr-id.txt)"
- name: download dist artifact
uses: dawidd6/action-download-artifact@v2
uses: dawidd6/action-download-artifact@v4
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
workflow_conclusion: success
@ -77,7 +77,7 @@ jobs:
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'failure'
steps:
- name: download pr artifact
uses: dawidd6/action-download-artifact@v2
uses: dawidd6/action-download-artifact@v4
with:
workflow: ${{ github.event.workflow_run.workflow_id }}
name: pr

Loading…
Cancel
Save