Skip to content
Open
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
17 changes: 17 additions & 0 deletions .github/workflows/linux-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Node.js CI (Linux - Ubuntu)

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Run linux CI in dockerfile
run: docker build . --file Dockerfile.test
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions

name: Node.js CI
name: Node.js CI (Windows)

on:
push:
Expand Down
48 changes: 48 additions & 0 deletions Dockerfile.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Dockerfile for Linux build automation.
#
# Demonstrates developing PoE-Overlay on Linux and produces testable Linux
# builds. Each step will be cached independently, so subsequent builds will be
# faster. First build will take up to 10 minutes.
# IMPORTANT: Set DOCKER_BUILDKIT=1 in your environment variables or you will not
# get any build artifacts in your release folder.
ARG codedir=/opt/PoE-Overlay-Community-Fork

# Since the Electron builder targets Debian packaging, start with an Ubuntu LTS image.
FROM ubuntu:20.04 AS build-stage

# Install build environment dependencies.
RUN apt-get update
RUN apt-get install -y libx11-dev libxtst-dev libpng-dev wget make g++ git lsb-release gnupg
# https://github.com/nodesource/distributions/blob/0d3d988/README.md#installation-instructions
RUN wget https://deb.nodesource.com/setup_12.x -O nodesource.sh
RUN bash nodesource.sh
RUN apt-get install -y nodejs
RUN DEBIAN_FRONTEND="noninteractive" TZ="America/New_York" apt-get install -y tzdata

# Install Google Chrome
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
RUN apt-get update && apt-get install -y google-chrome-stable

# Set up working directory.
ARG codedir
RUN mkdir $codedir
WORKDIR $codedir

# Copy the code into the container, avoiding .git and node_modules.
COPY *.json $codedir/
COPY browserslist $codedir
COPY dev-app-update.yml $codedir
COPY main.ts $codedir
COPY overlay.babel $codedir
COPY electron $codedir/electron
COPY img $codedir/img
COPY src $codedir/src
COPY karma*.conf.js $codedir/

# Install NodeJS dependencies/modules.
RUN npm install

# Run tests
# If you get an out of memory error, increase Docker's resources.
RUN npm run ng:test:ci
9 changes: 8 additions & 1 deletion karma-ci.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,13 @@ var generateBaseConfig = require('./karma-base.conf');
module.exports = function(config) {
config.set(Object.assign({}, generateBaseConfig(config), {
autoWatch: false,
singleRun: true
singleRun: true,
customLaunchers: {
ChromeCI: {
base: 'ChromeHeadless',
flags: ['--no-sandbox'],
},
},
browsers: ['ChromeCI'],
}));
}