Skip to content

Commit

Permalink
chore(template): sync with ahmadnassri/template-node-lib
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmad Nassri committed Aug 5, 2022
1 parent c4c9c5c commit 7e9edc4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 20 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ lint: ## run super-linter
@docker compose run --rm lint

install: ## install all dependencies
@docker compose run --rm -e NPM_TOKEN=$(NPM_TOKEN) -e GITHUB_TOKEN=$(GITHUB_TOKEN) -v $(NPMRC):/root/.npmrc test npm install --no-fund --no-audit
@docker compose run --rm -e NPM_TOKEN=$(NPM_TOKEN) -e GITHUB_TOKEN=$(GITHUB_TOKEN) -v $(NPMRC):/root/.npmrc node npm install --no-fund --no-audit

test: install ## run all npm tests
@docker compose run --rm test npm run test:ci
test: ## run all npm tests
@docker compose --profile test up

clean: ## remove running containers, volumes, node_modules & anything else
@docker compose rm --force -v
Expand Down
38 changes: 21 additions & 17 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,10 @@
# Note: this file originates in template-node-lib #
# ----------------------------------------------- #

version: '3.8'

x-node: &node
tty: true
volumes:
- type: bind
source: .
target: /app
working_dir: /app
command: npm run test

services:
# ---- super-linter ---- #
lint:
profiles: ["dev"]
image: github/super-linter:v3
volumes:
- ./:/github/workspace
Expand All @@ -29,11 +19,22 @@ services:

# ---- readme generator ---- #
readme:
profiles: ["dev"]
image: pandoc/core:2.13
volumes:
- ./:/data
command: --defaults=.pandoc.yml

node: &node
image: node:alpine
tty: true
volumes:
- type: bind
source: .
target: /app
working_dir: /app
command: npm --no-update-notifier run test -- --reporter=classic

test:
<<: *node
image: node:alpine
Expand All @@ -42,14 +43,17 @@ services:
- node16
- node18

node12:
<<: *node
image: node:12-alpine

node14:
<<: *node
profiles: ["test"]
image: node:14-alpine

node15:
node16:
<<: *node
profiles: ["test"]
image: node:16-alpine

node18:
<<: *node
image: node:15-alpine
profiles: ["test"]
image: node:18-alpine

0 comments on commit 7e9edc4

Please sign in to comment.