Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maintenance on GHA to keep reporting going #3

Merged
merged 16 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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