Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -440,8 +440,8 @@ jobs:
if: (needs.build-cli.result == 'success' || needs.build-cli.result == 'skipped') && (needs.build-cli-linux.result == 'success' || needs.build-cli-linux.result == 'skipped') && github.event_name == 'release'
uses: ./.github/workflows/build_offline_installer_archives.yaml
with:
run_number: ${{ github.run_number }}
ref: ${{ github.event.pull_request.head.ref || github.ref }}
run_id: ${{ github.run_id }}

build-gui:
name: Build GUI (${{ matrix.package_name }})
Expand Down Expand Up @@ -736,15 +736,15 @@ jobs:
if: needs.build-cli.result == 'success' && needs.build-cli-linux.result == 'success'
uses: ./.github/workflows/test_cli.yml
with:
run_number: ${{ github.run_number }}
run_id: ${{ github.run_id }}
ref: ${{ github.event.pull_request.head.ref || github.ref }}

Autotest-GUI:
needs: [build-gui]
if: needs.build-gui.result == 'success'
uses: ./.github/workflows/test_gui.yml
with:
run_number: ${{ github.run_number }}
run_id: ${{ github.run_id }}
ref: ${{ github.event.pull_request.head.ref || github.ref }}

update-release-info:
Expand Down
29 changes: 22 additions & 7 deletions .github/workflows/build_offline_installer_archives.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ name: Build Offline Installer Archives
on:
workflow_call:
inputs:
run_number:
ref:
required: true
type: string
ref:
run_id:
required: true
type: string

workflow_dispatch:
inputs:
run_number:
description: 'The run number from which to take binaries'
run_id:
description: "The run id from which to take binaries"
required: true
type: string

Expand All @@ -37,16 +38,22 @@ jobs:
package_name: macos-x64
steps:
- name: Download offline_installer_builder artifact
uses: actions/download-artifact@v4
uses: actions/download-artifact@v5
with:
name: offline_installer_builder-${{ matrix.package_name }}-${{ github.run_number }}
pattern: offline_installer_builder-${{ matrix.package_name }}-*
merge-multiple: true
path: ./
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ inputs.run_id || github.run_id }}

- name: Download eim artifact
uses: actions/download-artifact@v4
with:
name: eim-cli-${{ matrix.package_name }}-${{ github.run_number }}
pattern: eim-cli-${{ matrix.package_name }}-*
merge-multiple: true
path: ./
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ inputs.run_id || github.run_id }}

- name: Make binary executable (Unix)
if: runner.os != 'Windows'
Expand Down Expand Up @@ -115,3 +122,11 @@ jobs:
asset_path: offline_installer-${{ matrix.package_name }}-${{ env.VERSION }}.zip
asset_name: offline_installer-${{ matrix.package_name }}-${{ env.VERSION }}.zip
asset_content_type: application/zip

Autotest-CLI-Offline:
needs: [build-offline-archives]
if: needs.build-offline-archives.result == 'success'
uses: ./.github/workflows/test_offline.yml
with:
ref: ${{ inputs.ref || github.ref }}
run_id: ${{ github.run_id }}
16 changes: 13 additions & 3 deletions .github/workflows/test_cli.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
name: Autotest
name: Autotest CLI

on:
workflow_call:
inputs:
run_number:
run_id:
required: true
type: string
ref:
required: true
type: string

workflow_dispatch:
inputs:
run_id:
description: "The run id from which to take binaries"
required: true
type: string

jobs:
test:
name: CLI (${{ matrix.package_name }}${{ matrix.run_on == 'MirrorRunner' && '-AlternateMirrors' || '' }}${{contains(github.event.pull_request.labels.*.name, 'CNRUNNER') && '-CN' || '' }})
Expand Down Expand Up @@ -51,8 +58,11 @@ jobs:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: eim-cli-${{ matrix.package_name }}-${{ inputs.run_number }}
pattern: eim-cli-${{ matrix.package_name }}-*
path: ./artifacts
merge-multiple: true
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ inputs.run_id }}

# Non-Windows steps

Expand Down
19 changes: 16 additions & 3 deletions .github/workflows/test_gui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@ name: Autotest GUI
on:
workflow_call:
inputs:
run_number:
run_id:
required: true
type: string
ref:
required: true
type: string

workflow_dispatch:
inputs:
run_id:
description: "The run id from which to take binaries"
required: true
type: string

jobs:
test-cli-in-gui:
name: CLI in GUI (${{ matrix.package_name }})
Expand Down Expand Up @@ -48,8 +55,11 @@ jobs:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: eim-gui-${{ matrix.package_name }}-${{ inputs.run_number }}
pattern: eim-gui-${{ matrix.package_name }}-*
path: ./artifacts
merge-multiple: true
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ inputs.run_id }}

# Non-Windows steps

Expand Down Expand Up @@ -214,8 +224,11 @@ jobs:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: eim-gui-${{ matrix.package_name }}-${{ inputs.run_number }}
pattern: eim-gui-${{ matrix.package_name }}-*
path: ./artifacts
merge-multiple: true
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ inputs.run_id }}

# Non-Windows steps

Expand Down
201 changes: 201 additions & 0 deletions .github/workflows/test_offline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,201 @@
name: Autotest Offline

on:
workflow_call:
inputs:
ref:
required: true
type: string
run_id:
required: true
type: string

workflow_dispatch:
inputs:
run_id:
description: "The run id from which to take the offline installer archive"
required: true
type: string

jobs:
test-offline:
name: Offline (${{ matrix.package_name }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
package_name: linux-x64
run_on: GitHub
- os: windows-latest
package_name: windows-x64
run_on: GitHub
- os: macos-latest
package_name: macos-aarch64
run_on: GitHub
- os: ubuntu-24.04-arm
package_name: linux-aarch64
run_on: GitHub
- os: macos-13
package_name: macos-x64
run_on: GitHub

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"

- name: Download Archive
uses: actions/download-artifact@v5
with:
pattern: offline_installer-${{ matrix.package_name }}-*
merge-multiple: true
path: ./artifacts
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ inputs.run_id }}

# Non-Windows steps

- name: Get CLI application version number (non-Windows)
if: matrix.os != 'windows-latest'
run: |
git fetch --tags
LATEST_TAG=$(git tag --sort=-creatordate | head -n 1)
STRIPPED_TAG=${LATEST_TAG#v}
echo "CLI_TAG=$STRIPPED_TAG" >> $GITHUB_ENV

- name: Make EIM executable (non-Windows)
if: matrix.os != 'windows-latest'
run: |
ls -la ./artifacts/
unzip ./artifacts/offline_installer*.zip -d ./artifacts/
mv ./artifacts/archive_v*.zst ./artifacts/archive.zst
ls -la ./artifacts/
chmod +x artifacts/eim

- name: Install dependencies and node.js (Ubuntu)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm'
run: |
sudo add-apt-repository ppa:deadsnakes/ppa -y
sudo apt-get update
sudo apt-get install -y git wget flex bison gperf ccache libffi-dev libssl-dev dfu-util libusb-1.0-0-dev libgcrypt20 libglib2.0-0 libpixman-1-0 libsdl2-2.0-0 libslirp0 python3.11 python3.11-venv python3-pip
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 3
python3 --version
cd tests
npm ci

- name: Install dependencies and node.js (MacOS)
if: matrix.os == 'macos-latest' || matrix.os == 'macos-13'
run: |
brew install dfu-util libgcrypt glib pixman sdl2 libslirp python3
brew install [email protected]
rm /opt/homebrew/bin/python3
ln -s ../Cellar/[email protected]/3.11.13/bin/python3.11 /opt/homebrew/bin/python3
python3 --version
cd tests
npm ci

- name: Run IDF offline installation (non-Windows)
if: matrix.os != 'windows-latest'
run: |
export HTTP_PROXY="http://127.0.0.1:9"
export HTTPS_PROXY="http://127.0.0.1:9"
export NO_PROXY="localhost,127.0.0.1"
export LOG_TO_FILE="true"
export EIM_CLI_PATH="../artifacts/eim"
export EIM_OFFLINE_ARCHIVE="../artifacts/archive.zst"
export EIM_CLI_VERSION="eim ${{ env.CLI_TAG }}"
cd tests
npm run test-CLI --file=CLI-offline
unset HTTP_PROXY HTTPS_PROXY NO_PROXY
continue-on-error: true

# Windows steps

- name: Get CLI application version number (Windows)
if: matrix.os == 'windows-latest'
run: |
git fetch --tags
$LATEST_TAG = (git tag --sort=-creatordate | Select-Object -First 1)
$STRIPPED_TAG = $LATEST_TAG -replace '^v', ''
echo "CLI_TAG=$STRIPPED_TAG" | Out-File -FilePath $env:GITHUB_ENV -Append

- name: Check artifact (Windows)
if: matrix.os == 'windows-latest'
run: |
ls ./artifacts/
Expand-Archive ./artifacts/offline_installer*.zip -DestinationPath ./artifacts/
Move-Item "./artifacts/archive_v*.zst" "artifacts/archive.zst"
ls ./artifacts/

- name: Run IDF offline installation (Windows)
if: matrix.os == 'windows-latest'
run: |
$env:HTTP_PROXY = 'http://127.0.0.1:9'
$env:HTTPS_PROXY = 'http://127.0.0.1:9'
$env:NO_PROXY = 'localhost,127.0.0.1'
$env:LOG_TO_FILE="true"
$env:EIM_CLI_PATH = "..\artifacts\eim.exe"
$env:EIM_OFFLINE_ARCHIVE = "..\artifacts\archive.zst"
$env:EIM_CLI_VERSION = "eim ${{ env.CLI_TAG }}"
Set-Location -Path "./tests"
Expand-Archive node_modules.zip
npm run test-CLI-win --file=CLI-offline
Remove-Item Env:HTTP_PROXY, Env:HTTPS_PROXY, Env:NO_PROXY -ErrorAction SilentlyContinue
continue-on-error: true

# Copy eim log files to standard location for easier access
- name: Copy EIM Log files (ubuntu)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm'
run: |
cp ~/.local/share/eim/logs/*.log ./tests/
continue-on-error: true

- name: Copy EIM Log files (MacOS)
if: matrix.os == 'macos-latest' || matrix.os == 'macos-13'
run: |
cp ~/Library/Application\ Support/eim/logs/*.log ./tests/
continue-on-error: true

- name: Copy EIM Log files (Windows)
if: matrix.os == 'windows-latest'
run: |
Move-Item -Path "$env:LOCALAPPDATA\eim\logs\*" -Destination ".\tests\" -Force
continue-on-error: true

# Upload test results
- name: Upload test results (non-windows)
uses: actions/upload-artifact@v4
if: matrix.os != 'windows-latest'
with:
name: autotest-CLI-Offline-results-${{ matrix.package_name }}
path: |
./tests/results-*.json
./tests/*.log

- name: Upload test results (windows)
uses: actions/upload-artifact@v4
if: matrix.os == 'windows-latest'
with:
name: autotest-CLI-Offline-results-${{ matrix.package_name }}
path: |
./tests/results-*.json
./tests/*.log

# Publish test results
- name: Publish Test Results
uses: dorny/test-reporter@v2
if: always()
with:
name: CLI-Offline-Autotests-${{ matrix.package_name }}
path: ./tests/results-*.json
path-replace-backslashes: "false"
reporter: mocha-json
fail-on-empty: true
Loading
Loading