2022-08-25 20:04:14 +02:00
name : Build and Test
2022-04-25 19:58:34 +02:00
on :
2023-02-22 14:51:19 +01:00
pull_request : {}
push :
branches : [ develop, staging, master]
2022-05-27 10:15:47 +02:00
concurrency :
2023-02-22 14:51:19 +01:00
group : ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress : true
2024-11-22 11:18:33 +01:00
permissions : {} # No permissions required
2022-04-25 19:58:34 +02:00
jobs :
2023-02-22 14:51:19 +01:00
fetch :
uses : ./.github/workflows/build_prepare.yaml
2024-11-22 11:18:33 +01:00
permissions :
contents : read
2023-02-22 14:51:19 +01:00
with :
config : ${{ github.event.pull_request.base.ref == 'develop' && 'element.io/nightly' || 'element.io/release' }}
version : ${{ github.event.pull_request.base.ref == 'develop' && 'develop' || '' }}
2022-07-11 11:33:27 +02:00
2023-02-22 14:51:19 +01:00
windows :
needs : fetch
name : Windows
uses : ./.github/workflows/build_windows.yaml
strategy :
matrix :
2024-01-08 13:40:59 +01:00
arch : [ x64, ia32]
2023-02-22 14:51:19 +01:00
with :
arch : ${{ matrix.arch }}
2022-04-25 19:58:34 +02:00
2023-02-22 14:51:19 +01:00
linux :
2024-05-15 00:13:03 +02:00
needs : fetch
2023-04-18 12:38:26 +02:00
name : "Linux (${{ matrix.arch }}) (sqlcipher: ${{ matrix.sqlcipher }})"
2023-02-22 14:51:19 +01:00
uses : ./.github/workflows/build_linux.yaml
strategy :
matrix :
sqlcipher : [ system, static]
2023-04-18 12:38:26 +02:00
arch : [ amd64, arm64]
2023-02-22 14:51:19 +01:00
with :
2023-03-07 16:53:53 +01:00
config : ${{ github.event.pull_request.base.ref == 'develop' && 'element.io/nightly' || 'element.io/release' }}
2023-02-22 14:51:19 +01:00
sqlcipher : ${{ matrix.sqlcipher }}
2023-04-18 12:38:26 +02:00
arch : ${{ matrix.arch }}
2022-04-25 19:58:34 +02:00
2023-02-22 14:51:19 +01:00
macos :
needs : fetch
name : macOS
uses : ./.github/workflows/build_macos.yaml
2022-08-25 20:04:14 +02:00
2023-02-22 14:51:19 +01:00
test :
needs :
- macos
- linux
- windows
strategy :
matrix :
include :
- name : macOS Universal
2024-10-17 11:54:00 +02:00
os : macos-14
2023-02-22 14:51:19 +01:00
artifact : macos
2024-01-09 16:56:04 +01:00
executable : "/Users/runner/Applications/Element.app/Contents/MacOS/Element"
# We need to mount the DMG and copy the app to the Applications folder as a mounted DMG is
# read-only and thus would not allow us to override the fuses as is required for Playwright.
prepare_cmd : |
hdiutil attach ./dist/*.dmg -mountpoint /Volumes/Element &&
rsync -a /Volumes/Element/Element.app ~/Applications/ &&
hdiutil detach /Volumes/Element
2023-04-18 12:38:26 +02:00
- name : "Linux (amd64) (sqlcipher: system)"
2024-10-14 14:38:13 +02:00
os : ubuntu-22.04
2023-04-18 12:38:26 +02:00
artifact : linux-amd64-sqlcipher-system
2024-01-09 16:56:04 +01:00
executable : "/opt/Element/element-desktop"
2024-07-09 16:37:30 +02:00
prepare_cmd : "sudo apt-get -qq update && sudo apt install ./dist/*.deb"
2023-04-18 12:38:26 +02:00
- name : "Linux (amd64) (sqlcipher: static)"
2024-10-14 14:38:13 +02:00
os : ubuntu-22.04
2023-04-18 12:38:26 +02:00
artifact : linux-amd64-sqlcipher-static
2024-01-09 16:56:04 +01:00
executable : "/opt/Element/element-desktop"
2024-07-09 16:37:30 +02:00
prepare_cmd : "sudo apt-get -qq update && sudo apt install ./dist/*.deb"
2024-05-14 16:56:25 +02:00
- name : "Linux (arm64) (sqlcipher: system)"
os : dind-l-arm64
artifact : linux-arm64-sqlcipher-system
executable : "/opt/Element/element-desktop"
2024-07-09 16:37:30 +02:00
prepare_cmd : "sudo apt-get -qq update && sudo apt install -y ./dist/*.deb"
2024-05-15 00:13:03 +02:00
- name : "Linux (arm64) (sqlcipher: static)"
os : dind-l-arm64
artifact : linux-arm64-sqlcipher-static
executable : "/opt/Element/element-desktop"
2024-07-09 16:37:30 +02:00
prepare_cmd : "sudo apt-get -qq update && sudo apt install -y ./dist/*.deb"
2023-02-22 14:51:19 +01:00
- name : Windows (x86)
2024-10-17 11:54:00 +02:00
os : windows-2022
2024-01-08 13:40:59 +01:00
artifact : win-ia32
2023-02-22 14:51:19 +01:00
executable : "./dist/win-ia32-unpacked/Element.exe"
- name : Windows (x64)
2024-10-17 11:54:00 +02:00
os : windows-2022
2023-02-22 14:51:19 +01:00
artifact : win-x64
executable : "./dist/win-unpacked/Element.exe"
name : Test ${{ matrix.name }}
2024-05-14 16:56:25 +02:00
runs-on : ${{ matrix.os }}
2023-02-22 14:51:19 +01:00
steps :
2024-05-14 16:56:25 +02:00
# Workaround for self-hosted runners lacking yarn
- name : Install Yarn
if : runner.environment == 'self-hosted'
run : |
2024-07-15 12:04:02 +02:00
# Sanity check that the arch is arm64 as we expect
[ [ $(uname -p) == "aarch64" ]] || exit 1
2024-05-14 16:56:25 +02:00
sudo apt-get -qq update
sudo apt-get install -y curl
curl -fsSL --create-dirs -o $HOME/bin/yarn https://github.com/yarnpkg/yarn/releases/download/v1.22.19/yarn-1.22.19.js
chmod +x $HOME/bin/yarn
echo "$HOME/bin" >> $GITHUB_PATH
2024-01-02 18:24:45 +01:00
- uses : actions/checkout@v4
2022-08-25 20:04:14 +02:00
2024-01-02 18:37:20 +01:00
- uses : actions/setup-node@v4
2023-02-22 14:51:19 +01:00
with :
2024-01-18 11:10:51 +01:00
node-version-file : package.json
2023-02-22 14:51:19 +01:00
cache : "yarn"
2022-07-11 11:33:27 +02:00
2023-02-22 14:51:19 +01:00
- name : Install Deps
2023-03-31 17:17:43 +02:00
run : "yarn install --frozen-lockfile"
2022-04-25 19:58:34 +02:00
2024-01-08 13:40:59 +01:00
- uses : actions/download-artifact@v4
2023-02-22 14:51:19 +01:00
with :
name : ${{ matrix.artifact }}
path : dist
2022-08-25 20:04:14 +02:00
2023-02-22 14:51:19 +01:00
- name : Prepare for tests
run : ${{ matrix.prepare_cmd }}
if : matrix.prepare_cmd
2022-08-25 20:04:14 +02:00
2024-01-09 16:56:04 +01:00
# We previously disabled the `EnableNodeCliInspectArguments` fuse, but Playwright requires
2024-01-11 19:49:20 +01:00
# it to be enabled to test Electron apps, so turn it back on.
2024-01-09 16:56:04 +01:00
- name : Set EnableNodeCliInspectArguments fuse enabled
run : $RUN_AS npx @electron/fuses write --app ${{ matrix.executable }} EnableNodeCliInspectArguments=on
shell : bash
env :
# We need sudo on Linux as it is installed in /opt/
RUN_AS : ${{ runner.os == 'Linux' && 'sudo' || '' }}
2024-07-10 17:01:04 +02:00
- name : Workaround macOS GHA permission issues
2024-10-17 11:54:00 +02:00
if : runner.os == 'macOS'
2024-07-10 17:01:04 +02:00
run : |
sqlite3 $HOME/Library/Application\ Support/com.apple.TCC/TCC.db "INSERT OR IGNORE INTO access VALUES ('kTCCServiceMicrophone','/usr/local/opt/runner/provisioner/provisioner',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159,NULL,NULL,'UNUSED',1687786159);"
sqlite3 $HOME/Library/Application\ Support/com.apple.TCC/TCC.db "INSERT OR IGNORE INTO access VALUES ('kTCCServiceMicrophone','/opt/off/opt/runner/provisioner/provisioner',1,2,4,1,NULL,NULL,0,'UNUSED',NULL,0,1687786159,NULL,NULL,'UNUSED',1687786159);"
2023-02-22 14:51:19 +01:00
- name : Run tests
2024-02-21 10:17:44 +01:00
uses : coactions/setup-xvfb@6b00cf1889f4e1d5a48635647013c0508128ee1a
2023-02-22 14:51:19 +01:00
timeout-minutes : 5
with :
2024-01-11 19:49:20 +01:00
run : "yarn test ${{ runner.os != 'Linux' && '--ignore-snapshots' || '' }}"
2023-02-22 14:51:19 +01:00
env :
ELEMENT_DESKTOP_EXECUTABLE : ${{ matrix.executable }}
2022-08-25 20:04:14 +02:00
2024-01-11 19:49:20 +01:00
- name : Upload HTML report
2024-03-12 19:31:13 +01:00
if : always()
2024-01-17 10:32:54 +01:00
uses : actions/upload-artifact@v4
2023-02-22 14:51:19 +01:00
with :
2024-01-08 13:40:59 +01:00
name : ${{ matrix.artifact }}-test
2024-03-12 19:31:13 +01:00
path : playwright/html-report
2024-01-11 19:49:20 +01:00
retention-days : 14