Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add linux config for ci #28

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
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
47 changes: 47 additions & 0 deletions Dockerfile.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# 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

# 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'],
}));
}