2022-08-25 18:04:14 +00:00
|
|
|
name: Build and Test
|
2022-04-25 17:58:34 +00:00
|
|
|
on:
|
|
|
|
pull_request: { }
|
|
|
|
push:
|
|
|
|
branches: [ develop, master ]
|
2022-05-27 08:15:47 +00:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
2022-04-25 17:58:34 +00:00
|
|
|
jobs:
|
2022-07-11 09:33:27 +00:00
|
|
|
fetch:
|
2022-11-11 15:15:21 +00:00
|
|
|
uses: ./.github/workflows/build_prepare.yaml
|
2022-11-14 11:09:07 +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 09:33:27 +00:00
|
|
|
|
2022-04-25 17:58:34 +00:00
|
|
|
windows:
|
2022-07-11 09:33:27 +00:00
|
|
|
needs: fetch
|
2022-11-11 15:15:21 +00:00
|
|
|
name: Windows
|
|
|
|
uses: ./.github/workflows/build_windows.yaml
|
2022-11-14 11:09:07 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
arch: [ x64, x86 ]
|
|
|
|
with:
|
|
|
|
arch: ${{ matrix.arch }}
|
2022-04-25 17:58:34 +00:00
|
|
|
|
|
|
|
linux:
|
2022-07-11 09:33:27 +00:00
|
|
|
needs: fetch
|
2022-11-11 15:15:21 +00:00
|
|
|
name: Linux
|
|
|
|
uses: ./.github/workflows/build_linux.yaml
|
2022-11-14 11:09:07 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
sqlcipher: [ system, static ]
|
|
|
|
with:
|
|
|
|
sqlcipher: ${{ matrix.sqlcipher }}
|
2022-04-25 17:58:34 +00:00
|
|
|
|
|
|
|
macos:
|
2022-07-11 09:33:27 +00:00
|
|
|
needs: fetch
|
2022-11-11 15:15:21 +00:00
|
|
|
name: macOS
|
|
|
|
uses: ./.github/workflows/build_macos.yaml
|
2022-08-25 18:04:14 +00:00
|
|
|
|
|
|
|
test:
|
|
|
|
needs:
|
|
|
|
- macos
|
|
|
|
- linux
|
|
|
|
- windows
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
2022-12-15 15:21:04 +00:00
|
|
|
- name: macOS Universal
|
|
|
|
os: macos
|
|
|
|
artifact: macos
|
|
|
|
executable: "./dist/mac-universal/Element.app/Contents/MacOS/Element"
|
|
|
|
prepare_cmd: "find ./dist/mac-universal/Element.app -type f | perl -lne 'print if -B' | tr '\\n' '\\0' | xargs -0 -n1 chmod 755"
|
2022-08-25 18:04:14 +00:00
|
|
|
- name: 'Linux (sqlcipher: system)'
|
|
|
|
os: ubuntu
|
|
|
|
artifact: linux-sqlcipher-system
|
|
|
|
executable: "element-desktop"
|
|
|
|
prepare_cmd: "sudo apt install ./dist/*.deb"
|
|
|
|
- name: 'Linux (sqlcipher: static)'
|
|
|
|
os: ubuntu
|
|
|
|
artifact: linux-sqlcipher-static
|
|
|
|
executable: "element-desktop"
|
|
|
|
prepare_cmd: "sudo apt install ./dist/*.deb"
|
|
|
|
- name: Windows (x86)
|
|
|
|
os: windows
|
|
|
|
artifact: win-x86
|
|
|
|
executable: "./dist/win-ia32-unpacked/Element.exe"
|
|
|
|
- name: Windows (x64)
|
|
|
|
os: windows
|
|
|
|
artifact: win-x64
|
|
|
|
executable: "./dist/win-unpacked/Element.exe"
|
|
|
|
name: Test ${{ matrix.name }}
|
|
|
|
runs-on: ${{ matrix.os }}-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- uses: actions/setup-node@v3
|
|
|
|
with:
|
|
|
|
cache: "yarn"
|
|
|
|
|
|
|
|
- name: Install Deps
|
|
|
|
run: "yarn install --pure-lockfile"
|
|
|
|
|
|
|
|
- uses: actions/download-artifact@v3
|
|
|
|
with:
|
|
|
|
name: ${{ matrix.artifact }}
|
|
|
|
path: dist
|
|
|
|
|
|
|
|
- name: Prepare for tests
|
|
|
|
run: ${{ matrix.prepare_cmd }}
|
|
|
|
if: matrix.prepare_cmd
|
|
|
|
|
|
|
|
- name: Run tests
|
|
|
|
uses: GabrielBB/xvfb-action@v1
|
|
|
|
timeout-minutes: 5
|
|
|
|
with:
|
|
|
|
run: "yarn test"
|
|
|
|
env:
|
|
|
|
ELEMENT_DESKTOP_EXECUTABLE: ${{ matrix.executable }}
|
|
|
|
|
|
|
|
- name: Upload Artifacts
|
|
|
|
uses: actions/upload-artifact@v3
|
2022-12-15 15:21:04 +00:00
|
|
|
if: always()
|
2022-08-25 18:04:14 +00:00
|
|
|
with:
|
|
|
|
name: ${{ matrix.artifact }}
|
|
|
|
path: test_artifacts
|
|
|
|
retention-days: 1
|