Format build.yaml

This commit is contained in:
Andy Balaam 2022-12-15 16:18:39 +00:00
parent a99f9a6aee
commit c6d44418b5

View file

@ -1,11 +1,11 @@
name: Build and Test name: Build and Test
on: on:
pull_request: {} pull_request: {}
push: push:
branches: [develop, master] branches: [develop, master]
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.ref }} group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true cancel-in-progress: true
jobs: jobs:
fetch: fetch:
uses: ./.github/workflows/build_prepare.yaml uses: ./.github/workflows/build_prepare.yaml
@ -19,7 +19,7 @@ jobs:
uses: ./.github/workflows/build_windows.yaml uses: ./.github/workflows/build_windows.yaml
strategy: strategy:
matrix: matrix:
arch: [ x64, x86 ] arch: [x64, x86]
with: with:
arch: ${{ matrix.arch }} arch: ${{ matrix.arch }}
@ -29,7 +29,7 @@ jobs:
uses: ./.github/workflows/build_linux.yaml uses: ./.github/workflows/build_linux.yaml
strategy: strategy:
matrix: matrix:
sqlcipher: [ system, static ] sqlcipher: [system, static]
with: with:
sqlcipher: ${{ matrix.sqlcipher }} sqlcipher: ${{ matrix.sqlcipher }}
@ -51,12 +51,12 @@ jobs:
artifact: macos artifact: macos
executable: "./dist/mac-universal/Element.app/Contents/MacOS/Element" 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" prepare_cmd: "find ./dist/mac-universal/Element.app -type f | perl -lne 'print if -B' | tr '\\n' '\\0' | xargs -0 -n1 chmod 755"
- name: 'Linux (sqlcipher: system)' - name: "Linux (sqlcipher: system)"
os: ubuntu os: ubuntu
artifact: linux-sqlcipher-system artifact: linux-sqlcipher-system
executable: "element-desktop" executable: "element-desktop"
prepare_cmd: "sudo apt install ./dist/*.deb" prepare_cmd: "sudo apt install ./dist/*.deb"
- name: 'Linux (sqlcipher: static)' - name: "Linux (sqlcipher: static)"
os: ubuntu os: ubuntu
artifact: linux-sqlcipher-static artifact: linux-sqlcipher-static
executable: "element-desktop" executable: "element-desktop"
@ -76,98 +76,32 @@ jobs:
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
with: with:
config: ${{ github.event.pull_request.base.ref == 'develop' && 'element.io/nightly' || 'element.io/release' }} cache: "yarn"
version: ${{ github.event.pull_request.base.ref == 'develop' && 'develop' || '' }}
windows: - name: Install Deps
needs: fetch run: "yarn install --pure-lockfile"
name: Windows
uses: ./.github/workflows/build_windows.yaml - uses: actions/download-artifact@v3
strategy:
matrix:
arch: [x64, x86]
with: with:
arch: ${{ matrix.arch }} name: ${{ matrix.artifact }}
path: dist
linux: - name: Prepare for tests
needs: fetch run: ${{ matrix.prepare_cmd }}
name: Linux if: matrix.prepare_cmd
uses: ./.github/workflows/build_linux.yaml
strategy: - name: Run tests
matrix: uses: GabrielBB/xvfb-action@v1
sqlcipher: [system, static] timeout-minutes: 5
with: with:
sqlcipher: ${{ matrix.sqlcipher }} run: "yarn test"
env:
ELEMENT_DESKTOP_EXECUTABLE: ${{ matrix.executable }}
macos: - name: Upload Artifacts
needs: fetch uses: actions/upload-artifact@v3
name: macOS if: always()
uses: ./.github/workflows/build_macos.yaml with:
name: ${{ matrix.artifact }}
test: path: test_artifacts
needs: retention-days: 1
- macos
- linux
- windows
strategy:
matrix:
include:
# Disable macOS tests for now, they fail to run in CI, needs investigation.
# - name: macOS Universal
# os: macos
# artifact: macos
# executable: "./dist/mac-universal/Element.app/Contents/MacOS/Element"
# prepare_cmd: "chmod +x ./dist/mac-universal/Element.app/Contents/MacOS/Element"
- 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
with:
name: ${{ matrix.artifact }}
path: test_artifacts
retention-days: 1