Skip to content

Commit

Permalink
attempt: Attempt #1 at GitHub Actions for our Try/test thing
Browse files Browse the repository at this point in the history
  • Loading branch information
EntraptaJ committed Mar 16, 2020
1 parent 53c2f2b commit 4e9a2f5
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "API Container",
"name": "TS-ESNode Container",
"dockerFile": "./Dockerfile.dev",
"settings": {
// This dev container does include /bin/bash if you prefer to use it instead of ash.
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/Push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: CI

on:
push:

jobs:
Test:
name: Test/Try
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: k-foss/npm-run-action
with:
scriptName: 'prepare'
scriptPath: 'test/'
- uses: k-foss/npm-run-action
with:
scriptName: 'try'
23 changes: 4 additions & 19 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,24 +1,9 @@

FROM mhart/alpine-node:13
# This Dockerfile adds a non-root user with sudo access. Use the "remoteUser"
# property in devcontainer.json to use it. On Linux, the container user's GID/UIDs
# will be updated to match your local UID/GID (when using the dockerFile property).
# See https://aka.ms/vscode-remote/containers/non-root-user for details.
ARG USERNAME=node
ARG USER_UID=1000
ARG USER_GID=$USER_UID

# Install Shadow non busybox for better user management & support
RUN apk add --no-cache shadow git

# Create a non-root user to use if preferred - see https://aka.ms/vscode-remote/containers/non-root-user.
RUN groupadd -g $USER_GID $USERNAME \
&& useradd -s /bin/sh -K MAIL_DIR=/dev/null -u $USER_UID -g $USER_GID -m $USERNAME
FROM node:alpine3.11
RUN apk add --no-cache git

# Add Sudo to allow occasional usage of root. I wish I could remove this but I can't seem to get the node_modules volume working correctly.
RUN apk add --no-cache sudo \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME

&& echo node ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/node \
&& chmod 0440 /etc/sudoers.d/node

CMD [ "tail", "-f", "/dev/null" ]
3 changes: 2 additions & 1 deletion test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"private": true,
"type": "module",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "echo \"Error: no test specified\" && exit 1",
"prepare": "npm ci"
},
"author": "",
"license": "ISC",
Expand Down

0 comments on commit 4e9a2f5

Please sign in to comment.