Skip to content

Commit

Permalink
ci: add actions
Browse files Browse the repository at this point in the history
  • Loading branch information
viceice committed Apr 23, 2024
1 parent bbd53c5 commit 8c1da8f
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 12 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: build

on:
push:
pull_request:
workflow_dispatch:


concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true

jobs:
test-old:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || github.repository_owner != github.event.pull_request.head.repo.owner.login }}

strategy:
fail-fast: false
matrix:
node:
- 18.x
- 16.x
- 14.x
- 12.x
- 10.x
- 8.x

steps:
- name: Checkout
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
with:
show-progress: false

- name: install pnpm
run: curl -fsSL https://get.pnpm.io/install.sh | sh -

- name: Setup node
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version: ${{ matrix.node }}
cache: pnpm

- name: Install project
run: pnpm install --frozen-lockfile

- name: test
run: pnpm test


test:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' || github.repository_owner != github.event.pull_request.head.repo.owner.login }}

steps:
- name: Checkout
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
with:
show-progress: false

- name: enable corepack
run: corepack enable

- name: Setup node
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
node-version-file: .node-version
cache: pnpm

- name: enable corepack
run: corepack enable

- name: Install project
run: pnpm install --frozen-lockfile

- name: test
run: pnpm test
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
20.12.2
12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

0 comments on commit 8c1da8f

Please sign in to comment.