Skip to content

Commit

Permalink
ci: GitHub Actions (#8)
Browse files Browse the repository at this point in the history
* attempt: Attempt #1 at GitHub Actions for our Try/test thing

* fix: Include ref in action step use

* random commit to test CI

* fix: Remove prepare installing

* Revert "random commit to test CI"

This reverts commit 29030da.
  • Loading branch information
EntraptaJ authored Mar 16, 2020
1 parent 53c2f2b commit b77b739
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@master
with:
scriptName: 'prepare'
scriptPath: 'test/'
- uses: k-foss/npm-run-action@master
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": "echo 'Hello'"
},
"author": "",
"license": "ISC",
Expand Down

0 comments on commit b77b739

Please sign in to comment.