2022-08-25 19:04:14 +01:00
name : Build and Test
2022-04-25 18:58:34 +01:00
on :
2023-02-22 13:51:19 +00:00
pull_request : {}
push :
branches : [ develop, staging, master]
2022-05-27 09:15:47 +01:00
concurrency :
2023-02-22 13:51:19 +00:00
group : ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress : true
2024-11-22 10:18:33 +00:00
permissions : {} # No permissions required
2022-04-25 18:58:34 +01:00
jobs :
2023-02-22 13:51:19 +00:00
fetch :
uses : ./.github/workflows/build_prepare.yaml
2024-11-22 10:18:33 +00:00
permissions :
contents : read
2023-02-22 13:51:19 +00: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 10:33:27 +01:00
2023-02-22 13:51:19 +00:00
windows :
needs : fetch
name : Windows
uses : ./.github/workflows/build_windows.yaml
strategy :
matrix :
2025-02-17 10:07:31 +00:00
arch : [ x64]
2023-02-22 13:51:19 +00:00
with :
arch : ${{ matrix.arch }}
2022-04-25 18:58:34 +01:00
2025-02-13 10:49:51 +00:00
linux :
needs : fetch
name : "Linux (${{ matrix.arch }}) (sqlcipher: ${{ matrix.sqlcipher }})"
uses : ./.github/workflows/build_linux.yaml
strategy :
matrix :
sqlcipher : [ system, static]
arch : [ amd64, arm64]
with :
config : ${{ github.event.pull_request.base.ref == 'develop' && 'element.io/nightly' || 'element.io/release' }}
sqlcipher : ${{ matrix.sqlcipher }}
arch : ${{ matrix.arch }}
macos :
needs : fetch
name : macOS
uses : ./.github/workflows/build_macos.yaml
2023-02-22 13:51:19 +00:00
test :
needs :
2025-02-13 10:49:51 +00:00
- macos
- linux
2023-02-22 13:51:19 +00:00
- windows
strategy :
matrix :
include :
2025-02-13 10:49:51 +00:00
- name : macOS Universal
os : macos-14
artifact : macos
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
- name : "Linux (amd64) (sqlcipher: system)"
os : ubuntu-22.04
artifact : linux-amd64-sqlcipher-system
executable : "/opt/Element/element-desktop"
prepare_cmd : "sudo apt-get -qq update && sudo apt install ./dist/*.deb"
- name : "Linux (amd64) (sqlcipher: static)"
os : ubuntu-22.04
artifact : linux-amd64-sqlcipher-static
executable : "/opt/Element/element-desktop"
prepare_cmd : "sudo apt-get -qq update && sudo apt install ./dist/*.deb"
- name : "Linux (arm64) (sqlcipher: system)"
os : ubuntu-22.04-arm
artifact : linux-arm64-sqlcipher-system
executable : "/opt/Element/element-desktop"
prepare_cmd : "sudo apt-get -qq update && sudo apt install -y ./dist/*.deb"
- name : "Linux (arm64) (sqlcipher: static)"
os : ubuntu-22.04-arm
artifact : linux-arm64-sqlcipher-static
executable : "/opt/Element/element-desktop"
prepare_cmd : "sudo apt-get -qq update && sudo apt install -y ./dist/*.deb"
2025-02-17 10:07:31 +00:00
# - name: Windows (x86)
# os: windows-2022
# artifact: win-ia32
# executable: "./dist/win-ia32-unpacked/Element.exe"
2025-02-17 09:38:53 +00:00
- name : Windows (x64)
2025-02-13 10:41:25 +00:00
os : windows-2022
artifact : win-x64
2025-02-17 09:38:53 +00:00
executable : "./dist/win-unpacked/Element.exe"
2023-02-22 13:51:19 +00:00
name : Test ${{ matrix.name }}
2024-05-14 15:56:25 +01:00
runs-on : ${{ matrix.os }}
2023-02-22 13:51:19 +00:00
steps :
2024-01-02 17:24:45 +00:00
- uses : actions/checkout@v4
2022-08-25 19:04:14 +01:00
2024-01-02 17:37:20 +00:00
- uses : actions/setup-node@v4
2023-02-22 13:51:19 +00:00
with :
2024-01-18 10:10:51 +00:00
node-version-file : package.json
2023-02-22 13:51:19 +00:00
cache : "yarn"
2022-07-11 10:33:27 +01:00
2023-02-22 13:51:19 +00:00
- name : Install Deps
2023-03-31 16:17:43 +01:00
run : "yarn install --frozen-lockfile"
2022-04-25 18:58:34 +01:00
2024-01-08 12:40:59 +00:00
- uses : actions/download-artifact@v4
2023-02-22 13:51:19 +00:00
with :
name : ${{ matrix.artifact }}
path : dist
2022-08-25 19:04:14 +01:00
2023-02-22 13:51:19 +00:00
- name : Prepare for tests
run : ${{ matrix.prepare_cmd }}
if : matrix.prepare_cmd
2022-08-25 19:04:14 +01:00
2024-01-09 15:56:04 +00:00
# We previously disabled the `EnableNodeCliInspectArguments` fuse, but Playwright requires
2024-01-11 18:49:20 +00:00
# it to be enabled to test Electron apps, so turn it back on.
2024-01-09 15:56:04 +00: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 16:01:04 +01:00
- name : Workaround macOS GHA permission issues
2024-10-17 10:54:00 +01:00
if : runner.os == 'macOS'
2024-07-10 16:01:04 +01: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 13:51:19 +00:00
- name : Run tests
2024-02-21 09:17:44 +00:00
uses : coactions/setup-xvfb@6b00cf1889f4e1d5a48635647013c0508128ee1a
2023-02-22 13:51:19 +00:00
timeout-minutes : 5
with :
2024-01-11 18:49:20 +00:00
run : "yarn test ${{ runner.os != 'Linux' && '--ignore-snapshots' || '' }}"
2023-02-22 13:51:19 +00:00
env :
ELEMENT_DESKTOP_EXECUTABLE : ${{ matrix.executable }}
2022-08-25 19:04:14 +01:00
2024-01-11 18:49:20 +00:00
- name : Upload HTML report
2024-03-12 18:31:13 +00:00
if : always()
2024-01-17 09:32:54 +00:00
uses : actions/upload-artifact@v4
2023-02-22 13:51:19 +00:00
with :
2024-01-08 12:40:59 +00:00
name : ${{ matrix.artifact }}-test
2024-03-12 18:31:13 +00:00
path : playwright/html-report
2024-01-11 18:49:20 +00:00
retention-days : 14