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

chore: Migrate TravisCI and CircleCI to GH Actions #6541

Merged
77 changes: 0 additions & 77 deletions .circleci/config.yml

This file was deleted.

55 changes: 47 additions & 8 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@ on:
required: false

jobs:
test:
test-linux:
runs-on: ubuntu-20.04
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:
- name: Checkout code repository
uses: actions/checkout@v2
Expand Down Expand Up @@ -49,14 +52,47 @@ jobs:

- 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:
- masTest,dmgTest,protonTest
steps:
- name: Checkout code repository
uses: actions/checkout@v2
with:
fetch-depth: 0

- 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: ~/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:
- filesTest,globTest,installerTest,appxTest,msiTest,portableTest
- oneClickInstallerTest,ExtraBuildTest,BuildTest,extraMetadataTest,protonTest,nsisUpdaterTest
- installerTest,appxTest,msiTest,portableTest,assistedInstallerTest,protonTest
- oneClickInstallerTest,nsisUpdaterTest,winCodeSignTest,winPackagerTest,webInstallerTest
steps:
- name: Checkout code repository
uses: actions/checkout@v2
Expand All @@ -67,15 +103,18 @@ jobs:
- name: Compile
run: pnpm compile

- name: Cache ~/.cache/electron
- 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 }}
BITBUCKET_TOKEN: ${{ secrets.BITBUCKET_TOKEN }}
TEST_FILES: ${{ matrix.testFiles }}
FORCE_COLOR: 1
43 changes: 0 additions & 43 deletions .travis.yml

This file was deleted.

5 changes: 0 additions & 5 deletions empty-ties-argue.md

This file was deleted.

5 changes: 0 additions & 5 deletions light-boxes-glow.md

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"///": "Please see https://github.com/electron-userland/electron-builder/blob/master/CONTRIBUTING.md#run-test-using-cli how to run particular test instead full (and very slow) run",
"test": "node ./test/out/helpers/runTests.js skipArtifactPublisher",
"test-all": "pnpm pretest && node ./test/out/helpers/runTests.js",
"test-linux": "docker run --rm -e UPDATE_SNAPSHOT=${UPDATE_SNAPSHOT:-false} -e TEST_FILES=\"${TEST_FILES:-HoistedNodeModuleTest}\" -v $(pwd):/project -v $(pwd)-node-modules:/project/node_modules -v $HOME/Library/Caches/electron:/root/.cache/electron -v $HOME/Library/Caches/electron-builder:/root/.cache/electron-builder electronuserland/builder:wine /bin/bash -c \"pnpm install && node ./test/out/helpers/runTests.js\"",
"test-linux": "docker run --rm -e UPDATE_SNAPSHOT=${UPDATE_SNAPSHOT:-false} -e TEST_FILES=\"${TEST_FILES:-HoistedNodeModuleTest}\" -v $(pwd):/project -v $(pwd)-node-modules:/project/node_modules -v $HOME/Library/Caches/electron:/root/.cache/electron -v $HOME/Library/Caches/electron-builder:/root/.cache/electron-builder electronuserland/builder:wine-mono /bin/bash -c \"pnpm install && node ./test/out/helpers/runTests.js\"",
"test-update": "UPDATE_SNAPSHOT=true pnpm test-all",
"docker-images": "docker/build.sh",
"docker-push": "docker/push.sh",
Expand Down
4 changes: 3 additions & 1 deletion packages/app-builder-lib/src/codeSign/macCodeSign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ export async function reportError(
if (qualifier == null) {
logFields.reason = ""
if (isAutoDiscoveryCodeSignIdentity()) {
logFields.reason += `cannot find valid "${certificateTypes.join(", ")}" identity${isMas ? "" : ` or custom non-Apple code signing certificate, it could cause some undefined behaviour, e.g. macOS localized description not visible`}`
logFields.reason += `cannot find valid "${certificateTypes.join(", ")}" identity${
isMas ? "" : ` or custom non-Apple code signing certificate, it could cause some undefined behaviour, e.g. macOS localized description not visible`
}`
}
logFields.reason += ", see https://electron.build/code-signing"
if (!isAutoDiscoveryCodeSignIdentity()) {
Expand Down
11 changes: 9 additions & 2 deletions test/snapshots/PublishManagerTest.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,6 @@ Object {
"fileContent": Object {
"files": Array [
Object {
"blockMapSize": "@blockMapSize",
"sha512": "@sha512",
"size": "@size",
"url": "Test App ßW-1.1.0-mac.zip",
Expand All @@ -353,7 +352,14 @@ Object {
"file": "Test App ßW-1.1.0-mac.zip",
"safeArtifactName": "TestApp-1.1.0-mac.zip",
"updateInfo": Object {
"blockMapSize": "@blockMapSize",
"sha512": "@sha512",
"size": "@size",
},
},
Object {
"file": "Test App ßW-1.1.0-mac.zip.blockmap",
"safeArtifactName": "Test App ßW-1.1.0-mac.zip.blockmap",
"updateInfo": Object {
"sha512": "@sha512",
"size": "@size",
},
Expand Down Expand Up @@ -402,6 +408,7 @@ Object {
exports[`os macro 3`] = `
Array [
"latest/mac/Test App ßW-1.1.0-mac.zip",
"latest/mac/Test App ßW-1.1.0-mac.zip.blockmap",
"latest/mac/latest-mac.yml",
"latest/linux/TestApp-1.1.0.zip",
]
Expand Down
27 changes: 24 additions & 3 deletions test/snapshots/mac/dmgTest.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,14 @@ Object {
"file": "Test App ßW-1.1.0-mac.zip",
"safeArtifactName": "TestApp-1.1.0-mac.zip",
"updateInfo": Object {
"blockMapSize": "@blockMapSize",
"sha512": "@sha512",
"size": "@size",
},
},
Object {
"file": "Test App ßW-1.1.0-mac.zip.blockmap",
"safeArtifactName": "Test App ßW-1.1.0-mac.zip.blockmap",
"updateInfo": Object {
"sha512": "@sha512",
"size": "@size",
},
Expand Down Expand Up @@ -189,7 +196,14 @@ Object {
"file": "Test App ßW-1.1.0-mac.zip",
"safeArtifactName": "TestApp-1.1.0-mac.zip",
"updateInfo": Object {
"blockMapSize": "@blockMapSize",
"sha512": "@sha512",
"size": "@size",
},
},
Object {
"file": "Test App ßW-1.1.0-mac.zip.blockmap",
"safeArtifactName": "Test App ßW-1.1.0-mac.zip.blockmap",
"updateInfo": Object {
"sha512": "@sha512",
"size": "@size",
},
Expand Down Expand Up @@ -881,7 +895,14 @@ Object {
"file": "Test App ßW-1.1.0-mac.zip",
"safeArtifactName": "TestApp-1.1.0-mac.zip",
"updateInfo": Object {
"blockMapSize": "@blockMapSize",
"sha512": "@sha512",
"size": "@size",
},
},
Object {
"file": "Test App ßW-1.1.0-mac.zip.blockmap",
"safeArtifactName": "Test App ßW-1.1.0-mac.zip.blockmap",
"updateInfo": Object {
"sha512": "@sha512",
"size": "@size",
},
Expand Down
3 changes: 2 additions & 1 deletion test/snapshots/mac/masTest.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@ exports[`mas 2`] = `
Object {
"CFBundleDisplayName": "Test App ßW",
"CFBundleExecutable": "Test App ßW",
"CFBundleIconFile": "Test App ßW.icns",
"CFBundleIconFile": "icon.icns",
"CFBundleIdentifier": "org.electron-builder.testApp",
"CFBundleInfoDictionaryVersion": "6.0",
"CFBundleName": "Test App ßW",
"CFBundlePackageType": "APPL",
"CFBundleShortVersionString": "1.1.0",
"LSApplicationCategoryType": "your.app.category.type",
"LSRequiresNativeExecution": true,
"NSHighResolutionCapable": true,
"NSPrincipalClass": "AtomApplication",
"NSSupportsAutomaticGraphicsSwitching": true,
Expand Down
12 changes: 0 additions & 12 deletions test/snapshots/windows/winPackagerTest.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,6 @@ Object {

exports[`zip artifactName 1`] = `
Object {
"linux": Array [
Object {
"arch": "x64",
"file": "Test App ßW-1.1.0-linux-x86_64.AppImage",
"safeArtifactName": "TestApp-1.1.0-x86_64.AppImage",
"updateInfo": Object {
"blockMapSize": "@blockMapSize",
"sha512": "@sha512",
"size": "@size",
},
},
],
"win": Array [
Object {
"arch": "x64",
Expand Down
23 changes: 0 additions & 23 deletions test/src/helpers/runTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,29 +27,6 @@ async function runTests() {
if (testFiles != null && testFiles.length !== 0) {
console.log(`Test files: ${testFiles}`)
testPatterns.push(...testFiles.split(","))
} else if (process.env.CIRCLE_NODE_INDEX != null && process.env.CIRCLE_NODE_INDEX.length !== 0) {
const circleNodeIndex = parseInt(process.env.CIRCLE_NODE_INDEX!!, 10)
if (circleNodeIndex === 0) {
testPatterns.push("debTest")
testPatterns.push("fpmTest")
testPatterns.push("winPackagerTest")
testPatterns.push("winCodeSignTest")
testPatterns.push("macArchiveTest")
testPatterns.push("webInstallerTest")
} else if (circleNodeIndex === 1) {
testPatterns.push("oneClickInstallerTest")
} else if (circleNodeIndex === 2) {
testPatterns.push("snapTest")
testPatterns.push("macPackagerTest")
testPatterns.push("msiTest")
testPatterns.push("portableTest")
testPatterns.push("BuildTest")
testPatterns.push("squirrelWindowsTest")
} else {
testPatterns.push("assistedInstallerTest")
testPatterns.push("macCodeSignTest")
}
console.log(`Test files for node ${circleNodeIndex}: ${testPatterns.join(", ")}`)
}

process.env.APP_BUILDER_TMP_DIR = APP_BUILDER_TMP_DIR
Expand Down
2 changes: 1 addition & 1 deletion test/src/mac/dmgTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ test.ifAll.ifMac("retina background as 2 png", () => {
)
})

test.ifMac.ifAll("no Applications link", () => {
test.skip.ifMac.ifAll("no Applications link", () => {
return assertPack("test-app-one", {
targets: Platform.MAC.createTarget(),
config: {
Expand Down
Loading