Skip to content

Commit 7e83830

Browse files
committed
ci: added test checks, updated devcontainer
1 parent c1d3258 commit 7e83830

File tree

4 files changed

+57
-4
lines changed

4 files changed

+57
-4
lines changed

.devcontainer/Dockerfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
FROM node:18
2+
3+
# Install basic development tools
4+
RUN apt update && apt install -y less man-db sudo
5+
6+
# Ensure default `node` user has access to `sudo`
7+
ARG USERNAME=node
8+
RUN echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
9+
&& chmod 0440 /etc/sudoers.d/$USERNAME
10+
11+
# Set `DEVCONTAINER` environment variable to help with orientation
12+
ENV DEVCONTAINER=true

.devcontainer/devcontainer.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// See https://containers.dev/implementors/json_reference/ for configuration reference
2+
{
3+
"name": "Untitled Node.js project",
4+
"build": {
5+
"dockerfile": "Dockerfile"
6+
},
7+
"remoteUser": "node",
8+
"customizations": {
9+
"vscode": {
10+
"extensions": [
11+
"eamodio.gitlens"
12+
]
13+
}
14+
}
15+
}

.github/workflows/tests.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version: [16.x, 18.x]
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v1
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
- run: npm ci
25+
- run: npm run build
26+
- run: npm test

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)