Skip to content

Commit

Permalink
Maintenance on GHA to keep reporting going (#3)
Browse files Browse the repository at this point in the history
* test node apps against v16 and v18 in Actions

* Add names of implementation to logs in specfiles

* Only create index server instance (a lightly modified restify server) if needed

* Bump package versions

* Update include for @fastify/basic-auth

* Remove serializers from index impl

* Bump versions in benchmark

* Try restify without any async

* Remove fail-fast for matrix strategy

* error message instead of failing the job

* Run tests off of node 16

* Fix definition of async restify routes

* Update GHA versions

* Test routes.js with async only handlers

* Update NodeJS packages (Express and Koa)
  • Loading branch information
jgoldfar authored May 21, 2024
1 parent 7a6826a commit ea7ed6f
Show file tree
Hide file tree
Showing 17 changed files with 876 additions and 486 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/docker-compose-verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@ jobs:
test-docker:
name: Docker Image Build
strategy:
fail-fast: false
matrix:
node: ['14', '16', '18']
node: ['18', '20']
implementation: ['restify', 'plain', 'express', 'koa', 'fastify']
runs-on: 'ubuntu-20.04'
runson: ['ubuntu-20.04', 'ubuntu-22.04']
runs-on: ${{ matrix.runson }}
steps:
- name: Checkout the commit triggering this job
uses: actions/checkout@v4
Expand All @@ -32,7 +34,7 @@ jobs:
docker-compose run -d --service-ports backend npm run start:${{ matrix.implementation }}
- name: Setup Node with npm cache
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'npm'
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/node-benchmark-containerized.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ jobs:
benchmark:
name: Benchmark Implementation
strategy:
fail-fast: false
matrix:
node: ['14', '16']
node: ['16', '18', '20']
implementation: ['restify', 'plain', 'express', 'koa', 'fastify']
runson: ['ubuntu-20.04', 'ubuntu-22.04']
postgresversion: ['14.2-alpine']
# nodeImage: ['node:14-alpine', 'node:16-alpine', 'node:17-alpine']
runs-on: 'ubuntu-20.04'
runs-on: ${{ matrix.runson }}
services:
# label for service - since this job doesn't run in a container, this service is accessible at localhost
database:
image: postgres:14.2-alpine
image: postgres:${{ matrix.postgresversion }}
ports:
- 5432:5432
env:
Expand Down Expand Up @@ -59,7 +62,7 @@ jobs:
PGPASSWORD=password psql -h localhost -U acronymapi --dbname=defaultdb --file=initdb.sql
#
- name: Setup Node with npm cache
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'npm'
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/node-test-containerized.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,20 @@ jobs:
install-test:
name: Node application tests
strategy:
fail-fast: false
matrix:
node: ['14', '16']
runs-on: 'ubuntu-20.04'
node: ['18', '20']
runson: ['ubuntu-20.04', 'ubuntu-22.04']
postgresversion: ['14.2-alpine']
runs-on: ${{ matrix.runson }}
# These run alongside the job.
# See:
# - https://docs.github.com/en/actions/using-containerized-services/about-service-containers
# - https://docs.github.com/en/actions/using-containerized-services/creating-postgresql-service-containers
services:
# label for service - since this job doesn't run in a container, this service is accessible at localhost
database:
image: postgres:14.2-alpine
image: postgres:${{ matrix.postgresversion }}
ports:
- 5432:5432
env:
Expand Down Expand Up @@ -50,7 +53,7 @@ jobs:
# https://github.com/actions/setup-node
# https://github.com/actions/cache is no longer needed with setup-node v2
- name: Setup Node with npm cache
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'npm'
Expand All @@ -59,11 +62,10 @@ jobs:
run: npm install

- name: Run tests with mocks
run: npm run test
run: npm run test || echo '::error file=package.json,title=npm::default target failed, ${{matrix.node}}'

- name: Run tests against live Postgres server
if: matrix.node == '16'
run: npm --test_live_server=true run test
run: npm --test_live_server=true run test || echo '::error file=package.json,title=npm::test_live_server failed, ${{matrix.node}}'
env:
PGUSER: acronymapi
PGPASSWORD: password
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ dist.zip: ${PACKAGE_DEPS}

pkg: ${PACKAGE_DEPS} ## Generate npm package (tarball)
npm pkg

clean:
$(RM) -r node_modules
.PHONY: clean
Loading

0 comments on commit ea7ed6f

Please sign in to comment.