Skip to content

Commit

Permalink
updating CI
Browse files Browse the repository at this point in the history
  • Loading branch information
agracio committed Dec 4, 2024
1 parent 6fb961a commit 67b13c0
Show file tree
Hide file tree
Showing 2 changed files with 134 additions and 72 deletions.
65 changes: 65 additions & 0 deletions .github/actions/build-setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: 'Electron build'
description: 'Electron build'
inputs:
electron:
description: 'Electron version'
required: true
os:
description: 'runs-on'
required: false
default: 'windows-2022'

runs:
using: "composite"
steps:

- name: Setup env
uses: ./.github/actions/setup-env
with:
electron: '${{ inputs.electron }}.0.0'
os: ${{ inputs.os }}

- name: install node-gyp
shell: bash
run: npm i -g node-gyp

- name: Create release folder
shell: cmd
run: |
mkdir "release\ia32\${{ inputs.electron }}.0.0"
mkdir "release\x64\${{ inputs.electron }}.0.0"
mkdir "release\arm64\${{ inputs.electron }}.0.0"
- name: Cache node-gyp
uses: actions/cache@v4
env:
cache-name: cache-node-gyp
with:
path: ~\AppData\Local\node-gyp\Cache
key: '${{ inputs.electron }}.0.0'

- name: Build ia32
uses: ./.github/actions/build
with:
electron: ${{ inputs.electron }}
arch: 'ia32'

- name: Build x64
uses: ./.github/actions/build
with:
electron: ${{ inputs.electron }}
arch: 'x64'

- name: Build arm64
uses: ./.github/actions/build
with:
electron: ${{ inputs.electron }}
arch: 'arm64'

- name: Upload artifacts
uses: actions/upload-artifact@v4
if: success()
with:
name: electron-edge-js-${{ inputs.electron }}.0.0
path: |
release
141 changes: 69 additions & 72 deletions .github/workflows/build-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,94 +9,91 @@ env:
DOTNET_NOLOGO: 1

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
# fail-fast: false
matrix:
electron: [29, 30, 31, 32, 33]
# electron: [32, 33]
os: [windows-2022]
build-29:
runs-on: windows-2022
outputs:
electron: ${{ steps.electron-version.outputs.electron }}

name: build ${{ matrix.os }}-electron-${{ matrix.electron }}
name: build electron-29.0.0
steps:

- name: Checkout code
uses: actions/checkout@v4
- name: Setup env
uses: ./.github/actions/setup-env

- name: Build Electron 29
uses: ./.github/actions/setup-build
with:
electron: '${{ matrix.electron }}.0.0'
os: ${{ matrix.os }}
electron: 29
os: ${{ runner.os }}

- name: Electron version
shell: bash
id: electron-version
run: echo "electron=29.4.6" >> $GITHUB_OUTPUT

# - name: Setup env
# uses: ./.github/actions/setup-env
# with:
# electron: '${{ matrix.electron }}.0.0'
# os: ${{ runner.os }}

- name: install node-gyp
run: npm i -g node-gyp

- name: Create release folder
run: |
mkdir "release\ia32\${{ matrix.electron }}.0.0"
mkdir "release\x64\${{ matrix.electron }}.0.0"
mkdir "release\arm64\${{ matrix.electron }}.0.0"
- name: Cache node-gyp
uses: actions/cache@v4
env:
cache-name: cache-node-gyp
with:
path: ~\AppData\Local\node-gyp\Cache
key: '${{ matrix.electron }}.0.0'
# - name: install node-gyp
# run: npm i -g node-gyp

- name: Build ia32
timeout-minutes: 30
uses: ./.github/actions/build
with:
electron: ${{ matrix.electron }}
arch: 'ia32'
# - name: Create release folder
# run: |
# mkdir "release\ia32\${{ matrix.electron }}.0.0"
# mkdir "release\x64\${{ matrix.electron }}.0.0"
# mkdir "release\arm64\${{ matrix.electron }}.0.0"

- name: Build x64
timeout-minutes: 30
uses: ./.github/actions/build
with:
electron: ${{ matrix.electron }}
arch: 'x64'
# - name: Cache node-gyp
# uses: actions/cache@v4
# env:
# cache-name: cache-node-gyp
# with:
# path: ~\AppData\Local\node-gyp\Cache
# key: '${{ matrix.electron }}.0.0'

- name: Build arm64
timeout-minutes: 30
uses: ./.github/actions/build
with:
electron: ${{ matrix.electron }}
arch: 'arm64'

- name: Upload artifacts
uses: actions/upload-artifact@v4
if: success()
with:
name: electron-edge-js-${{ matrix.electron }}.0.0
path: |
release
# - name: Build ia32
# timeout-minutes: 30
# uses: ./.github/actions/build
# with:
# electron: ${{ matrix.electron }}
# arch: 'ia32'

electron-versions:
runs-on: ubuntu-22.04
outputs:
matrix: ${{ steps.electron-test-versions.outputs.matrix }}
# - name: Build x64
# timeout-minutes: 30
# uses: ./.github/actions/build
# with:
# electron: ${{ matrix.electron }}
# arch: 'x64'

needs: build
name: electron-versions
steps:
- name: Electron versions
shell: bash
id: electron-test-versions
run: echo "matrix={'include':[{'electron':'29.4.6', 'os':'windows-2022'},{'electron':'30.5.1', 'os':'windows-2022'},{'electron':'31.7.5', 'os':'windows-2022'},{'electron':'32.2.6', 'os':'windows-2022'},{'electron':'33.2.1', 'os':'windows-2022'}]}" >> $GITHUB_OUTPUT
# - name: Build arm64
# timeout-minutes: 30
# uses: ./.github/actions/build
# with:
# electron: ${{ matrix.electron }}
# arch: 'arm64'

# - name: Upload artifacts
# uses: actions/upload-artifact@v4
# if: success()
# with:
# name: electron-edge-js-${{ matrix.electron }}.0.0
# path: |
# release

test:

test-29:
strategy:
matrix: ${{ fromJSON(needs.electron-versions.outputs.matrix) }}
matrix:
os: [windows-2022]
runs-on: ${{ matrix.os }}
needs: electron-versions
needs: build-29

# fail-fast: false

name: test ${{ matrix.os }}-v${{ matrix.electron }}
name: test ${{ matrix.os }}-v ${{needs.build-29.outputs.electron}}
steps:

- name: Checkout code
Expand All @@ -105,7 +102,7 @@ jobs:
- name: Test build
uses: ./.github/actions/test-build
with:
electron: ${{ matrix.electron }}
electron: ${{ needs.build-29.outputs.electron }}
os: ${{ matrix.os }}


0 comments on commit 67b13c0

Please sign in to comment.