Skip to content

Commit

Permalink
chore: Separate Nsolid CI
Browse files Browse the repository at this point in the history
Signed-off-by: Jefferson <[email protected]>
  • Loading branch information
riosje committed Feb 29, 2024
1 parent 66123eb commit 1b209c9
Show file tree
Hide file tree
Showing 4 changed files with 276 additions and 37 deletions.
210 changes: 210 additions & 0 deletions .github/workflows/ci-nsolid.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
name: ci

on:
push:
branches:
- main
- master
- next
- 'v*'
paths-ignore:
- 'docs/**'
- '*.md'
pull_request:
paths-ignore:
- 'docs/**'
- '*.md'

# This allows a subsequently queued workflow run to interrupt previous runs
concurrency:
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
cancel-in-progress: true

jobs:
dependency-review:
name: Dependency Review
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Check out repo
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Dependency review
uses: actions/dependency-review-action@v4

check-licenses:
name: Check licenses
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
cache-dependency-path: package.json

- name: Install
run: |
npm install --ignore-scripts
- name: Check licenses
run: |
npx license-checker --production --summary --onlyAllow="0BSD;Apache-2.0;BSD-2-Clause;BSD-3-Clause;ISC;MIT;"
lint:
name: Lint
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
cache-dependency-path: package.json

- name: Install
run: |
npm install --ignore-scripts
- name: Lint code
run: |
npm run lint
coverage-nix:
needs: lint
permissions:
contents: read
uses: ./.github/workflows/coverage-nix.yml

coverage-win:
needs: lint
permissions:
contents: read
uses: ./.github/workflows/coverage-win.yml

test-unit:
needs:
- lint
- coverage-nix
- coverage-win
runs-on: ${{ matrix.os }}
permissions:
contents: read
strategy:
matrix:
nsolid-version: [5]
os: [macos-latest, ubuntu-latest, windows-latest]
include:
- nsolid-version: 5
node-version: 18
- nsolid-version: 5
node-version: 20
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- uses: nodesource/setup-nsolid@v1
with:
node-version: ${{ matrix.node-version }}
nsolid-version: ${{ matrix.nsolid-version }}

- name: Install
run: |
npm install --ignore-scripts
- name: Run tests
run: |
npm run unit
test-typescript:
needs:
- lint
- coverage-nix
- coverage-win
runs-on: 'ubuntu-latest'
permissions:
contents: read

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- uses: nodesource/setup-nsolid@v1
with:
node-version: 20
nsolid-version: 5

- name: Install
run: |
npm install --ignore-scripts
- name: Run typescript tests
run: |
npm run test:typescript
env:
NODE_OPTIONS: no-network-family-autoselection

package:
needs:
- test-typescript
- test-unit
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: nodesource/setup-nsolid@v1
with:
nsolid-version: 5
- name: install fastify
run: |
npm install --ignore-scripts
- name: install webpack stack
run: |
cd test/bundler/webpack && npm install
- name: Test webpack bundle
run: |
cd test/bundler/webpack && npm run test
- name: install esbuild stack
run: |
cd test/bundler/esbuild && npm install
- name: Test esbuild bundle
run: |
cd test/bundler/esbuild && npm run test
automerge:
if: >
github.event_name == 'pull_request' &&
github.event.pull_request.user.login == 'dependabot[bot]'
needs:
- test-typescript
- test-unit
- package
runs-on: ubuntu-latest
permissions:
pull-requests: write
contents: write
steps:
- uses: fastify/github-action-merge-dependabot@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
23 changes: 4 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ci
name: ci NSolid

on:
push:
Expand Down Expand Up @@ -109,39 +109,24 @@ jobs:

strategy:
matrix:
runtime: [node, nsolid]
node-version: [14, 16, 18, 20]
os: [macos-latest, ubuntu-latest, windows-latest]
include:
- runtime: nsolid
nsolid-version: 5
exclude:
# excludes node 14 on Windows
# excludes node 14 on Windows
- os: windows-latest
runtime: node
node-version: 14
# Nsolid 5 does not support Node.js 14, 16
- runtime: nsolid
node-version: 14
- runtime: nsolid
node-version: 16

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Use Node.js
if: ${{ matrix.runtime == 'node'}}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: package.json
- uses: nodesource/setup-nsolid@v1
if: ${{ matrix.runtime == 'nsolid'}}
with:
node-version: ${{ matrix.node-version }}
nsolid-version: ${{ matrix.nsolid-version }}

- name: Install
run: |
Expand Down Expand Up @@ -229,4 +214,4 @@ jobs:
steps:
- uses: fastify/github-action-merge-dependabot@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
github-token: ${{ secrets.GITHUB_TOKEN }}
60 changes: 60 additions & 0 deletions .github/workflows/integration-nsolid.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: integration NSolid

on:
push:
branches:
- main
- master
- next
- 'v*'
paths-ignore:
- 'docs/**'
- '*.md'
pull_request:
paths-ignore:
- 'docs/**'
- '*.md'

jobs:
install-production:
runs-on: ${{ matrix.os }}
permissions:
contents: read

strategy:
matrix:
nsolid-version: [5]
os: [ubuntu-latest]
pnpm-version: [8]
include:
- nsolid-version: 5
node-version: 18
- nsolid-version: 5
node-version: 20
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- uses: nodesource/setup-nsolid@v1
with:
node-version: ${{ matrix.node-version }}
nsolid-version: ${{ matrix.nsolid-version }}

- name: Install Pnpm
uses: pnpm/action-setup@v2
with:
version: ${{ matrix.pnpm-version }}

- name: Install Production
run: |
pnpm install --prod
- name: Run server
run: |
node integration/server.js &
- name: Test
if: ${{ success() }}
run: |
bash integration/test.sh
20 changes: 2 additions & 18 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,41 +23,25 @@ jobs:

strategy:
matrix:
runtime: [node, nsolid]
node-version: [16, 18, 20]
os: [ubuntu-latest]
pnpm-version: [8]
# pnpm@8 does not support Node.js 14 so include it separately
include:
- runtime: nsolid
nsolid-version: 5
- runtime: node
node-version: 14
- node-version: 14
os: ubuntu-latest
pnpm-version: 7
# Nsolid 5 does not support Node.js 14, 16
exclude:
- runtime: nsolid
node-version: 16


steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- name: Use Node.js
if: ${{ matrix.runtime == 'node'}}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- uses: nodesource/setup-nsolid@v1
if: ${{ matrix.runtime == 'nsolid'}}
with:
node-version: ${{ matrix.node-version }}
nsolid-version: ${{ matrix.nsolid-version }}

- name: Install Pnpm
uses: pnpm/action-setup@v2
with:
Expand All @@ -74,4 +58,4 @@ jobs:
- name: Test
if: ${{ success() }}
run: |
bash integration/test.sh
bash integration/test.sh

0 comments on commit 1b209c9

Please sign in to comment.