Skip to content

Commit

Permalink
Update github-ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
rubiin authored Oct 28, 2024
1 parent 7cbff90 commit 1e368ee
Showing 1 changed file with 77 additions and 30 deletions.
107 changes: 77 additions & 30 deletions .github/workflows/github-ci.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,87 @@
name: CI
on: [push, pull_request]

on:
push:
branches:
- master

pull_request:
branches:
- master

jobs:
build:
lint:
runs-on: ubuntu-latest
steps:
- uses: pnpm/action-setup@v4
name: Install pnpm
- uses: actions/setup-node@v4
name: Install node
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v3

- name: Set node
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: pnpm
- run: pnpm install --shamefully-hoist
- run: pnpm build

release:
name: release
if: ${{ github.ref == 'refs/heads/master' }}
needs:
- build
node-version: lts/*

- name: Setup
run: npm i -g @antfu/ni

- name: Install
run: nci

- name: Lint
run: nr lint

typecheck:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v4
id: release
- uses: actions/checkout@v4

- name: Install pnpm
uses: pnpm/action-setup@v3

- name: Set node
uses: actions/setup-node@v4
with:
release-type: node
package-name: ultimate-nest
node-version: lts/*

- name: Setup
run: npm i -g @antfu/ni

- name: Install
run: nci

- name: Typecheck
run: nr typecheck

test:
runs-on: ${{ matrix.os }}

strategy:
matrix:
node: [lts/*]
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false

steps:
- uses: actions/checkout@v4
- name: tag stable versions
if: ${{ steps.release.outputs.release_created }}
run: |
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
git remote add gh-token "https://${{ secrets.TOKEN_GITHUB }}@github.com/google-github-actions/release-please-action.git"
git tag -d stable || true
git push origin :stable || true
git tag -a stable -m "Last Stable Release"
git push origin stable

- name: Install pnpm
uses: pnpm/action-setup@v3

- name: Set node ${{ matrix.node }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}

- name: Setup
run: npm i -g @antfu/ni

- name: Install
run: nci

- name: Build
run: nr build

- name: Test
run: nr test

0 comments on commit 1e368ee

Please sign in to comment.