Skip to content

Commit

Permalink
test: switch to GitHub Actions CI (#1299)
Browse files Browse the repository at this point in the history
Drops AppVeyor and Travis CI.
  • Loading branch information
malept committed Nov 25, 2019
1 parent a2de8ea commit d822603
Show file tree
Hide file tree
Showing 10 changed files with 177 additions and 111 deletions.
38 changes: 0 additions & 38 deletions .appveyor.yml

This file was deleted.

118 changes: 118 additions & 0 deletions .github/workflows/ci.yml
@@ -0,0 +1,118 @@
name: CI

on:
push:
branches:
- master
tags:
- v[0-9]+.[0-9]+.[0-9]+*
pull_request:

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macOS-latest, ubuntu-latest]
node-installer: [npm, yarn]

steps:
- name: Fix git checkout line endings
run: git config --global core.autocrlf input
- uses: actions/checkout@v1
- name: Windows specific setup
if: matrix.os == 'windows-latest'
run: |
curl -OLS https://github.com/wixtoolset/wix3/releases/download/wix3111rtm/wix311.exe
.\wix311.exe /install /quiet /norestart
npm config set node-gyp "$($env:GITHUB_WORKSPACE)\node_modules\node-gyp\bin\node-gyp.js"
- name: Linux specific setup
if: matrix.os == 'ubuntu-latest'
run: |
sudo add-apt-repository -y ppa:alexlarsson/flatpak
sudo apt-get update
sudo apt-get install -y --no-install-recommends snapcraft flatpak-builder
ci/install_runtimes.sh
- name: Use Node.js 8.x
uses: actions/setup-node@v1
with:
node-version: 8.x
- name: Cache node_modules
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}-
- name: Install bolt
shell: bash
run: |
case "$(uname -s)" in
Windows*|CYGWIN*|MINGW*|MSYS*) BOLT_VERSION=0.21.2 ;;
*) BOLT_VERSION=latest ;;
esac
npm install -g bolt@$BOLT_VERSION
- name: Install
run: bolt
- name: Lint
run: bolt lint
- name: Build
run: bolt build
- name: Test on Windows
if: matrix.os == 'windows-latest'
run: |
$wixToolsetBinPath = ";C:\Program Files (x86)\WiX Toolset v3.11\bin;"
$env:PATH = $env:PATH + $wixToolsetBinPath
[Environment]::SetEnvironmentVariable("Path", $env:PATH, [EnvironmentVariableTarget]::Machine)
if ((Get-Command "light.exe" -ErrorAction SilentlyContinue) -eq $null)
{
Write-Host "Unable to find light.exe in your PATH"
}
bolt coverage
env:
CI: true
NODE_INSTALLER: ${{ matrix.node-installer }}
- name: Test on macOS/Linux
if: matrix.os != 'windows-latest'
run: bolt coverage
env:
CI: true
NODE_INSTALLER: ${{ matrix.node-installer }}
DEBUG: electron-installer-snap:snapcraft
- name: Codecov
run: bolt codecov
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
docs:
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
needs: build
runs-on: [ubuntu-latest]
steps:
- uses: actions/checkout@v1
- name: Use Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Cache node_modules
uses: actions/cache@v1
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}-
- name: Install bolt
shell: bash
run: |
case "$(uname -s)" in
Windows*|CYGWIN*|MINGW*|MSYS*) BOLT_VERSION=0.21.2 ;;
*) BOLT_VERSION=latest ;;
esac
npm install -g bolt@$BOLT_VERSION
- name: Deploy docs
run: ci/docs.sh
env:
NOW_TOKEN: ${{ secrets.NOW_TOKEN }}
39 changes: 0 additions & 39 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Expand Up @@ -83,7 +83,7 @@ bolt test

Here are some things to keep in mind as you file pull requests to fix bugs, add new features, etc.:

* Travis CI and AppVeyor are used to make sure that the project builds packages as expected on the
* GitHub Actions are used to make sure that the project builds packages as expected on the
supported platforms, using supported Node.js versions, and that the project conforms to the
configured coding standards.
* Unless it's impractical, please write tests for your changes. This will help us so that we can
Expand Down
3 changes: 1 addition & 2 deletions README.md
@@ -1,7 +1,6 @@
Electron Forge
--------------
[![Linux/macOS Build Status](https://travis-ci.org/electron-userland/electron-forge.svg?branch=master)](https://travis-ci.org/electron-userland/electron-forge)
[![Windows Build status](https://ci.appveyor.com/api/projects/status/79ae80nek1eucyy3?svg=true)](https://ci.appveyor.com/project/electron-userland/electron-forge)
[![Build Status](https://github.com/electron-userland/electron-forge/workflows/CI/badge.svg)](https://github.com/electron-userland/electron-forge/actions?query=workflow:CI)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![npm version](https://badge.fury.io/js/electron-forge.svg)](https://www.npmjs.com/package/electron-forge)
[![npm](https://img.shields.io/npm/dt/electron-forge.svg?maxAge=2592000)](https://www.npmjs.com/package/electron-forge)
Expand Down
20 changes: 0 additions & 20 deletions ci/docker.sh

This file was deleted.

2 changes: 1 addition & 1 deletion ci/docs.sh
@@ -1,7 +1,7 @@
#!/bin/bash -e

# Pinned due to https://github.com/zeit/now/issues/2941
yarn global add now@16.1.2
yarn add --dev now@16.1.2
bolt
bolt build
yarn docs:deploy:ci
35 changes: 35 additions & 0 deletions ci/install_runtimes.sh
@@ -0,0 +1,35 @@
#!/bin/bash -xe

install_app() {
local arch="$1"
local app="$2"
local branch=$3
install_flatpak "app/$app/$arch/$branch"
}

install_runtime() {
local arch="$1"
local runtime="$2"
local version="$3"
install_flatpak "runtime/${runtime}/$arch/$version"
}

install_flatpak() {
local ref="$1"
if [[ ! -d "$HOME/.local/share/flatpak/$ref" ]]; then
flatpak install --user --no-deps --assumeyes "$ref"
fi
}

flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

install_runtime x86_64 org.freedesktop.Sdk 1.6
install_runtime x86_64 org.freedesktop.Platform 1.6
install_app x86_64 org.electronjs.Electron2.BaseApp stable

mkdir -p fakesnap/snap
cp ci/snapcraft.yaml fakesnap/snap/
pushd fakesnap
snapcraft pull desktop-gtk3 electron-deps
popd
rm -r fakesnap
10 changes: 0 additions & 10 deletions ci/script.sh

This file was deleted.

21 changes: 21 additions & 0 deletions ci/snapcraft.yaml
@@ -0,0 +1,21 @@
name: electron-app
version: '1.0.0'
summary: App summary
description: |
App description
grade: devel
confinement: devmode

parts:
electron-deps:
plugin: nil
after:
- desktop-gtk3
stage-packages:
- libnotify4
- libnss3
- libpcre3
- libuuid1
- libxss1
- libxtst6

0 comments on commit d822603

Please sign in to comment.