Skip to content

Commit

Permalink
Merge branch 'electron-userland:master' into support-file-association…
Browse files Browse the repository at this point in the history
…s-in-msi
  • Loading branch information
aplum authored Jan 12, 2022
2 parents c52cd88 + 5648e05 commit dc964be
Show file tree
Hide file tree
Showing 54 changed files with 515 additions and 302 deletions.
5 changes: 0 additions & 5 deletions .changeset/shiny-kangaroos-juggle.md

This file was deleted.

39 changes: 1 addition & 38 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,36 +29,6 @@ jobs:
paths:
- ~/.cache/electron

test:
parallelism: 4
docker:
- image: electronuserland/builder:wine-mono-05.21@sha256:a623432c159a02019e77a71873dfc6d4bf45f4b2011b333dbca429f02ee4cc56
environment:
JEST_JUNIT_OUTPUT_DIR: /tmp/test-reports/test.xml
TZ: Europe/Berlin
steps:
- checkout
- restore_cache:
keys:
- install-dep-cache-{{ checksum "pnpm-lock.yaml" }}
- restore_cache:
keys:
- v-11.0.0-electron
# because in the build job we use circleci docker image and circleci restores cache to original user home
- run:
command: |
curl -L https://unpkg.com/@pnpm/self-installer | node
mkdir -p ~/.cache
mv /home/circleci/.cache/electron ~/.cache/electron
pnpm install --frozen-lockfile
- run:
# do not use yarn test because lint is done in the build job
command: pnpm run compile
- run:
command: node ./test/out/helpers/runTests.js
- store_test_results:
path: /tmp/test-reports

workflows:
version: 2
build_and_test:
Expand All @@ -67,11 +37,4 @@ workflows:
filters:
branches:
ignore:
- docs
- test:
filters:
branches:
ignore:
- docs
requires:
- build
- docs
29 changes: 29 additions & 0 deletions .github/actions/pnpm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: 'pnpm installation'
description: 'Install and audit dependencies via pnpm'
inputs:
version: # id of input
description: 'The pnpm version to use'
required: false
default: 6.25.1

runs:
using: 'composite'
steps:
- uses: pnpm/action-setup@v2
with:
version: ${{ inputs.version }}

- uses: actions/setup-node@v2
with:
node-version: '14'
cache: 'pnpm'

- name: install dependencies
run: pnpm install --frozen-lockfile
shell: bash

## Usage
# - name: install and audit
# uses: ./.github/actions/pnpm
# with:
# version: ${{ env.PNPM_VERSION }}
29 changes: 29 additions & 0 deletions .github/workflows/docker-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Docker Deployment

on:
# release:
# types: [published]
push:
tags:
- docker*

jobs:
deploy:
name: Build and Push Docker
runs-on: ubuntu-latest

steps:
- name: Checkout code repository
uses: actions/checkout@v2

- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build all Docker images
run: pnpm docker-images

- name: Push all Docker images
run: pnpm docker-push
3 changes: 2 additions & 1 deletion .github/workflows/label-manager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ jobs:
name: DefaultLabelsActions
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: actions/checkout@v2

- uses: lannonbr/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
39 changes: 6 additions & 33 deletions .github/workflows/pr-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,32 @@ on:
push:
branches:
- master

env:
HUSKY: 0 # Bypass husky commit hook for CI
PNPM_CACHE_FOLDER: .pnpm-store

jobs:
pr-release:
timeout-minutes: 15
runs-on: ubuntu-latest
steps:
- name: checkout code repository
- name: Checkout code repository
uses: actions/checkout@v2
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0

- uses: pnpm/action-setup@v2
with:
version: 6.10.0
- name: Install deps and audit
uses: ./.github/actions/pnpm

- uses: actions/setup-node@v2
with:
node-version: '14'
cache: 'pnpm'

- name: Set up NPM credentials
run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: setup pnpm config
run: pnpm config set store-dir $PNPM_CACHE_FOLDER

- run: pnpm install

- name: Create versions PR & prepare publish
id: changesets
uses: changesets/action@master
uses: changesets/action@v1
with:
version: pnpm ci:version
commit: 'chore(deploy): Release'
Expand All @@ -48,20 +38,3 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Push release version tag
if: steps.changesets.outputs.published == 'true'
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git push --follow-tags
git push origin releases
- name: Deploy Documentation
uses: netlify/actions/build@master
if: steps.changesets.outputs.published == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_CMD: bash netlify-docs.sh
NETLIFY_DIR: site
2 changes: 1 addition & 1 deletion .github/workflows/semantic-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ jobs:
steps:
# Please look up the latest version from
# https://github.com/amannn/action-semantic-pull-request/releases
- uses: amannn/action-semantic-pull-request@v3.5.0
- uses: amannn/action-semantic-pull-request@v3.6.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
130 changes: 84 additions & 46 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,73 +3,111 @@ name: Test
on:
push:
pull_request:
branches:
- master

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
build-docker-locally:
type: boolean
description: Force rebuild docker images for CI tests
required: false

jobs:
test:
test-linux:
runs-on: ubuntu-20.04
container:
image: electronuserland/builder:14-05.21@sha256:837f5cbec3735ee27eb7105b9646aedd73340bce7d6ea44943a99a105a4dca55
env:
TEST_FILES: configurationValidationTest,globTest,RepoSlugTest,mainEntryTest,ArtifactPublisherTest,ignoreTest,filesTest,nsisUpdaterTest,extraMetadataTest,linuxPackagerTest,linuxArchiveTest,protonTest
strategy:
matrix:
testFiles:
- ArtifactPublisherTest,BuildTest,ExtraBuildTest,RepoSlugTest,binDownloadTest,configurationValidationTest,filenameUtilTest,filesTest,globTest,ignoreTest,macroExpanderTest,mainEntryTest,urlUtilTest,extraMetadataTest,linuxArchiveTest,linuxPackagerTest,HoistedNodeModuleTest,PublishManagerTest
- snapTest,debTest,fpmTest,protonTest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
- name: Checkout code repository
uses: actions/checkout@v2
with:
node-version: 14
- name: Cache .pnpm-store
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install pnpm
run: |
npm i -g pnpm
pnpm config set store-dir ~/.pnpm-store
- run: pnpm install --frozen-lockfile
- run: pnpm compile
- run: pnpm lint
- run: pnpm lint-deps
fetch-depth: 0

- name: Install deps and audit
uses: ./.github/actions/pnpm

- name: Determine if Dockerfiles changed
id: changed-files
uses: tj-actions/changed-files@v13

- name: Dockerfile has changed, rebuild for tests
if: ${{ github.event.inputs.build-docker-locally == 'true' }} || contains(steps.changed-files.outputs.all_changed_files, 'Dockerfile') || contains(steps.changed-files.outputs.all_changed_files, 'docker')
run: pnpm docker-images

- name: Compile and Lint
run: pnpm pretest

- name: Cache ~/.cache/electron
uses: actions/cache@v2
with:
path: ~/.cache/electron
key: v-11.0.0-electron
- run: node ./test/out/helpers/runTests.js
test-windows:
runs-on: windows-2019

- name: Run tests in docker image
run: pnpm test-linux
env:
TEST_FILES: ${{ matrix.testFiles }}
FORCE_COLOR: 1

test-mac:
runs-on: macos-latest
strategy:
matrix:
testFiles:
- filesTest,globTest,installerTest,appxTest,msiTest,portableTest
- oneClickInstallerTest,ExtraBuildTest,BuildTest,extraMetadataTest,protonTest,nsisUpdaterTest
- masTest,dmgTest,protonTest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: 14
- name: Cache .pnpm-store
- name: Checkout code repository
uses: actions/checkout@v2

- name: Install deps and audit
uses: ./.github/actions/pnpm

- name: Compile
run: pnpm compile

- name: Cache ~/Library/Caches/electron
uses: actions/cache@v2
with:
path: $HOMEPATH/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install pnpm
run: |
npm i -g pnpm
pnpm config set store-dir $HOMEPATH/.pnpm-store
- run: pnpm install --frozen-lockfile
- run: pnpm compile
- name: Cache ~/.cache/electron
path: ~/Library/Caches/electron
key: v-11.0.0-mac-electron

- name: Test
run: node ./test/out/helpers/runTests.js
env:
TEST_FILES: ${{ matrix.testFiles }}
FORCE_COLOR: 1

test-windows:
runs-on: windows-2019
strategy:
matrix:
testFiles:
- installerTest,appxTest,msiTest,portableTest,assistedInstallerTest
- oneClickInstallerTest,nsisUpdaterTest,winCodeSignTest,winPackagerTest,webInstallerTest
steps:
- name: Checkout code repository
uses: actions/checkout@v2

- name: Install deps and audit
uses: ./.github/actions/pnpm

- name: Compile
run: pnpm compile

- name: Cache ~\AppData\Local\Cache\electron
uses: actions/cache@v2
with:
path: $HOMEPATH/.cache/electron
path: ~\AppData\Local\Cache\electron
key: v-11.0.0-windows-electron
- name: test

- name: Test
run: node ./test/out/helpers/runTests.js
env:
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
KEYGEN_TOKEN: ${{ secrets.KEYGEN_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
TEST_FILES: ${{ matrix.testFiles }}
FORCE_COLOR: 1
Loading

0 comments on commit dc964be

Please sign in to comment.