Skip to content

Commit

Permalink
ci: Add Nsolid CI and Integration tests as separate pipelines
Browse files Browse the repository at this point in the history
Signed-off-by: Jefferson <[email protected]>

ci: Add Nsolid CI and Integration
  • Loading branch information
riosje committed Feb 29, 2024
1 parent a033540 commit b8c84af
Show file tree
Hide file tree
Showing 3 changed files with 202 additions and 12 deletions.
124 changes: 124 additions & 0 deletions .github/workflows/ci-nsolid.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
name: ci NSolid

on:
push:
branches:
- main
- 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:
test-unit:
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:
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 }}
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
30 changes: 18 additions & 12 deletions docs/Reference/LTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ in this document:
given Fastify release line. This implies that only the latest Node.js release
of a given line is supported.

4. Major releases will be tested and verified against all [N|solid](https://doc
s.nodesource.com/nsolid/5.0/docs) releases lines those released aligned with
the [Node.js LTS policy](https://github.com/nodejs/Release) within the LTS
period of that given Fastify release line. This implies that only the latest
N|Solid release of a given line is supported.

A "month" is defined as 30 consecutive days.

> ## Security Releases and Semver
Expand All @@ -43,12 +49,12 @@ A "month" is defined as 30 consecutive days.
### Schedule
<a id="lts-schedule"></a>

| Version | Release Date | End Of LTS Date | Node.js |
| :------ | :----------- | :-------------- | :------------------- |
| 1.0.0 | 2018-03-06 | 2019-09-01 | 6, 8, 9, 10, 11 |
| 2.0.0 | 2019-02-25 | 2021-01-31 | 6, 8, 10, 12, 14 |
| 3.0.0 | 2020-07-07 | 2023-06-30 | 10, 12, 14, 16, 18 |
| 4.0.0 | 2022-06-08 | TBD | 14, 16, 18, 20 |
| Version | Release Date | End Of LTS Date | Node.js | Nsolid(Node) |
| :------ | :----------- | :-------------- | :------------------- | :------------- |
| 1.0.0 | 2018-03-06 | 2019-09-01 | 6, 8, 9, 10, 11 | |
| 2.0.0 | 2019-02-25 | 2021-01-31 | 6, 8, 10, 12, 14 | |
| 3.0.0 | 2020-07-07 | 2023-06-30 | 10, 12, 14, 16, 18 | v5(18) |
| 4.0.0 | 2022-06-08 | TBD | 14, 16, 18, 20 | v5(18), v5(20) |

### CI tested operating systems
<a id="supported-os"></a>
Expand All @@ -59,12 +65,12 @@ runners](https://docs.github.com/en/actions/using-github-hosted-runners/about-gi
for further details on what the latest virtual environment is in relation to the
YAML workflow labels below:

| OS | YAML Workflow Label | Package Manager | Node.js |
|---------|------------------------|---------------------------|--------------|
| Linux | `ubuntu-latest` | npm | 14,16,18,20 |
| Linux | `ubuntu-latest` | yarn,pnpm | 14,16,18,20 |
| Windows | `windows-latest` | npm | 14,16,18,20 |
| MacOS | `macos-latest` | npm | 14,16,18,20 |
| OS | YAML Workflow Label | Package Manager | Node.js | Nsolid(Node) |
|---------|------------------------|---------------------------|--------------|----------------|
| Linux | `ubuntu-latest` | npm | 14,16,18,20 | v5(18),v5(20) |
| Linux | `ubuntu-latest` | yarn,pnpm | 14,16,18,20 | v5(18),v5(20) |
| Windows | `windows-latest` | npm | 14,16,18,20 | v5(18),v5(20) |
| MacOS | `macos-latest` | npm | 14,16,18,20 | v5(18),v5(20) |

Using [yarn](https://yarnpkg.com/) might require passing the `--ignore-engines`
flag.

0 comments on commit b8c84af

Please sign in to comment.