Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Test] Autotest add post ESP-IDF install test #59

Merged
merged 19 commits into from
Oct 28, 2024
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
19 changes: 16 additions & 3 deletions .github/workflows/build_and_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ jobs:
run: |
chmod +x ./test-bin/eim

- name: Run test script (non-Windows)
- name: Run prerequisites test script (non-Windows)
if: runner.os != 'Windows'
run: |
export EIM_FILE_PATH="../../test-bin/eim"
Expand All @@ -242,14 +242,16 @@ jobs:
run: |
sudo apt-get install -y git cmake ninja-build wget flex bison gperf ccache libffi-dev libssl-dev dfu-util libusb-1.0-0-dev python3 python3-venv python3-pip

- name: Run test script (non-Windows)
- name: Run IDF installation and post install test script (non-Windows)
if: runner.os != 'Windows'
run: |
export EIM_FILE_PATH="../../test-bin/eim"
export EIM_VERSION="idf-im-cli 0.1.0"
export LOG_TO_FILE="true"
cd tests/script
npx mocha --exit --reporter mocha-junit-reporter --reporter-options mochaFile=../results.xml main.test.js
export IDF_SCRIPT=$HOME/.espressif/activate_idf_v5.3.1.sh
npx mocha --exit --reporter mocha-junit-reporter --reporter-options mochaFile=../results.xml postInstall.test.js

- name: Extract artifact (Windows)
if: runner.os == 'Windows'
Expand All @@ -258,7 +260,16 @@ jobs:
7z x ./artifacts/eim-${{ github.run_id }}-${{ matrix.os }}/eim.zip -otest-bin
# 7z x ./test-bin/eim.zip -otest-bin

- name: Set executable permissions (Windows)
# - name: downgrade powershell version (Windows)
# if: runner.os == 'Windows'
# run: |
# $extractPath = "C:\Program Files\PowerShell\7"
# Invoke-WebRequest -Uri "https://github.com/PowerShell/PowerShell/releases/download/v7.2.17/PowerShell-7.2.17-win-x64.zip" -OutFile "pwsh.zip"
# Remove-Item -Path $extractPath -Recurse -Force -ErrorAction SilentlyContinue
# Expand-Archive -Path "pwsh.zip" -DestinationPath $extractPath -Force
# pwsh --version

- name: Print powershell and windows version (Windows)
if: runner.os == 'Windows'
run: |
$PSVersionTable
Expand Down Expand Up @@ -287,6 +298,8 @@ jobs:
$env:LOG_TO_FILE="true"
Set-Location -Path "./tests/script"
npx mocha --exit --reporter mocha-junit-reporter --reporter-options mochaFile=../results.xml main.test.js
$env:IDF_SCRIPT="C:\esp\v5.3.1\Microsoft.PowerShell_profile.ps1"
npx mocha --exit --reporter mocha-junit-reporter --reporter-options mochaFile=../results.xml postInstall.test.js

- name: Upload test results
uses: actions/upload-artifact@v4
Expand Down
46 changes: 27 additions & 19 deletions .github/workflows/build_rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,15 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-12]
include:
- os: ubuntu-latest
package_name: linux-x64
- os: windows-latest
package_name: windows-x64
- os: macos-latest
package_name: macos-aarch64
- os: macos-12
package_name: macos-x64

steps:
- name: Checkout repository
Expand Down Expand Up @@ -69,17 +77,17 @@ jobs:
run: mkdir -p release

- name: Create release system directory
run: mkdir -p release/${{ matrix.os }}
run: mkdir -p release/${{ matrix.package_name }}

- name: Copy binary to release directory Windows
if: matrix.os == 'windows-latest'
run: cp target/release/idf-im-cli.exe release/${{ matrix.os }}/eim.exe
run: cp target/release/idf-im-cli.exe release/${{ matrix.package_name }}/eim.exe

- name: Copy binary to release directory POSIX
if: matrix.os != 'windows-latest'
run: |
cp target/release/idf-im-cli release/${{ matrix.os }}/eim
chmod +x release/${{ matrix.os }}/eim
cp target/release/idf-im-cli release/${{ matrix.package_name }}/eim
chmod +x release/${{ matrix.package_name }}/eim

- name: Codesign macOS eim executables
if: startsWith(matrix.os, 'macos')
Expand All @@ -94,13 +102,13 @@ jobs:
/usr/bin/security import certificate.p12 -k build.keychain -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign
/usr/bin/security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k espressif build.keychain

/usr/bin/codesign --entitlements eim.entitlement --options runtime --force -s "ESPRESSIF SYSTEMS (SHANGHAI) CO., LTD. (QWXF6GB4AV)" release/${{ matrix.os }}/eim -v
/usr/bin/codesign -v -vvv --deep release/${{ matrix.os }}/eim
/usr/bin/codesign --entitlements eim.entitlement --options runtime --force -s "ESPRESSIF SYSTEMS (SHANGHAI) CO., LTD. (QWXF6GB4AV)" release/${{ matrix.package_name }}/eim -v
/usr/bin/codesign -v -vvv --deep release/${{ matrix.package_name }}/eim

- name: Zip eim executable for notarization
if: startsWith(matrix.os, 'macos')
run: |
cd release/${{ matrix.os }}
cd release/${{ matrix.package_name }}
zip -r eim.zip eim

- name: Notarization of macOS eim executables
Expand All @@ -118,38 +126,38 @@ jobs:

echo "Create keychain profile"
xcrun notarytool store-credentials "eim-notarytool-profile" --apple-id $NOTARIZATION_USERNAME --team-id $NOTARIZATION_TEAM_ID --password $NOTARIZATION_PASSWORD
xcrun notarytool submit release/${{ matrix.os }}/eim.zip --keychain-profile "eim-notarytool-profile" --wait
xcrun notarytool submit release/${{ matrix.package_name }}/eim.zip --keychain-profile "eim-notarytool-profile" --wait

echo "Unzipping the executable"
unzip -o release/${{ matrix.os }}/eim.zip -d release/${{ matrix.os }}
unzip -o release/${{ matrix.package_name }}/eim.zip -d release/${{ matrix.package_name }}

# echo "Attach staple for eim executable"
# xcrun stapler staple release/${{ matrix.os }}/eim
# xcrun stapler staple release/${{ matrix.package_name }}/eim

- name: Zip artifacts (Windows)
if: matrix.os == 'windows-latest'
run: |
cd release/${{ matrix.os }}
cd release/${{ matrix.package_name }}
7z a -tzip eim.zip eim.exe

- name: Zip artifacts (POSIX)
if: matrix.os != 'windows-latest'
run: |
cd release/${{ matrix.os }}
cd release/${{ matrix.package_name }}
zip -r eim.zip eim

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: eim-${{ github.run_id }}-${{ matrix.os }}
path: release/${{ matrix.os }}/eim.zip
name: eim-${{ github.run_id }}-${{ matrix.package_name }}
path: release/${{ matrix.package_name }}/eim.zip

- name: Upload artifact for tag
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v4
with:
name: eim-${{ github.ref_name }}-${{ matrix.os }}
path: release/${{ matrix.os }}/eim.zip
name: eim-${{ github.ref_name }}-${{ matrix.package_name }}
path: release/${{ matrix.package_name }}/eim.zip

- name: Upload Release Asset
if: github.event_name == 'release' && github.event.action == 'created'
Expand All @@ -158,8 +166,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: release/${{ matrix.os }}/eim.zip
asset_name: eim-${{ github.ref_name }}-${{ matrix.os }}.zip
asset_path: release/${{ matrix.package_name }}/eim.zip
asset_name: eim-${{ github.ref_name }}-${{ matrix.package_name }}.zip
asset_content_type: application/zip

- name: Create aarch64-linux build
Expand Down
157 changes: 79 additions & 78 deletions .github/workflows/docs_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,95 +2,96 @@ name: Documentation Build and Deploy CI

on:
release:
types:
types:
- created
push:
branches:
- master
- release/*
- master
- release/*
paths:
- 'docs/**'
- '.github/workflows/docs_build.yml'
- "docs/**"
- ".github/workflows/docs_build.yml"
pull_request:
paths:
- 'docs/**'
- '.github/workflows/docs_build.yml'
- "docs/**"
- ".github/workflows/docs_build.yml"
workflow_dispatch:

jobs:

build-docs:
name: Build ESP-IDF Installation Manager Docs
name: Build ESP-IDF Installation Manager Docs
runs-on: ubuntu-22.04
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v5
with:
cache-dependency-path: docs/requirements.txt
cache: 'pip'
python-version: '3.10'
- name: Build
run: |
sudo apt update
sudo apt install python3-pip python3-setuptools
# GitHub CI installs pip3 and setuptools outside the path.
# Update the path to include them and run.
cd ./docs
PATH=/home/runner/.local/bin:$PATH pip3 install -r requirements.txt --prefer-binary
PATH=/home/runner/.local/bin:$PATH SPHINXOPTS="-W" build-docs -l en
- name: Archive Docs
uses: actions/upload-artifact@v4
with:
name: docs
path: docs
- name: Deploy Documentation to preview server
env:
# Deploy to production server
# DOCS_BUILD_DIR: "./docs/_build/"
DOCS_DEPLOY_PRIVATEKEY: ${{ secrets.DOCS_PREVIEW_PRIVATEKEY }}
DOCS_DEPLOY_PATH: ${{ secrets.DOCS_PREVIEW_PATH }}
DOCS_DEPLOY_SERVER: ${{ secrets.DOCS_PREVIEW_SERVER }}
DOCS_DEPLOY_SERVER_USER: ${{ secrets.DOCS_PREVIEW_USER }}
DOCS_DEPLOY_URL_BASE: ${{ secrets.DOCS_PREVIEW_URL_BASE }}
run: |
sudo apt update
sudo apt install python3-pip python3-setuptools
source ./docs/utils.sh
add_doc_server_ssh_keys $DOCS_DEPLOY_PRIVATEKEY $DOCS_DEPLOY_SERVER $DOCS_DEPLOY_SERVER_USER
export GIT_VER=$(git describe --always)
echo "PIP install requirements..."
pip3 install --user -r ./docs/requirements.txt
echo "Building the Docs..."
cd ./docs && build-docs -l en
echo "Deploy the Docs..."
export DOCS_BUILD_DIR=$GITHUB_WORKSPACE/docs/
cd $GITHUB_WORKSPACE/docs
deploy-docs
- name: Deploy Documentation to production server
if: github.event_name == 'release' && github.event.action == 'created'
env:
# Deploy to production server
# DOCS_BUILD_DIR: "./docs/_build/"
DOCS_DEPLOY_PRIVATEKEY: ${{ secrets.DOCS_PROD_PRIVATEKEY }}
DOCS_DEPLOY_PATH: ${{ secrets.DOCS_PROD_PATH }}
DOCS_DEPLOY_SERVER: ${{ secrets.DOCS_PROD_SERVER }}
DOCS_DEPLOY_SERVER_USER: ${{ secrets.DOCS_PROD_USER }}
DOCS_DEPLOY_URL_BASE: ${{ secrets.DOCS_PROD_URL_BASE }}
run: |
sudo apt update
sudo apt install python3-pip python3-setuptools
source ./docs/utils.sh
add_doc_server_ssh_keys $DOCS_DEPLOY_PRIVATEKEY $DOCS_DEPLOY_SERVER $DOCS_DEPLOY_SERVER_USER
export GIT_VER=$(git describe --always)
echo "PIP install requirements..."
pip3 install --user -r ./docs/requirements.txt
echo "Building the Docs..."
cd ./docs && build-docs -l en
echo "Deploy the Docs..."
export DOCS_BUILD_DIR=$GITHUB_WORKSPACE/docs/
cd $GITHUB_WORKSPACE/docs
deploy-docs
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-python@v5
with:
cache-dependency-path: docs/requirements.txt
cache: "pip"
python-version: "3.10"
- name: Build
run: |
sudo apt update
sudo apt install python3-pip python3-setuptools
# GitHub CI installs pip3 and setuptools outside the path.
# Update the path to include them and run.
cd ./docs
PATH=/home/runner/.local/bin:$PATH pip3 install -r requirements.txt --prefer-binary
PATH=/home/runner/.local/bin:$PATH SPHINXOPTS="-W" build-docs -l en
- name: Archive Docs
uses: actions/upload-artifact@v4
with:
name: docs
path: docs
- name: Deploy Documentation to preview server
env:
# Deploy to production server
# DOCS_BUILD_DIR: "./docs/_build/"
DOCS_DEPLOY_PRIVATEKEY: ${{ secrets.DOCS_PREVIEW_PRIVATEKEY }}
DOCS_DEPLOY_PATH: ${{ secrets.DOCS_PREVIEW_PATH }}
DOCS_DEPLOY_SERVER: ${{ secrets.DOCS_PREVIEW_SERVER }}
DOCS_DEPLOY_SERVER_USER: ${{ secrets.DOCS_PREVIEW_USER }}
DOCS_DEPLOY_URL_BASE: ${{ secrets.DOCS_PREVIEW_URL_BASE }}
run: |
sudo apt update
sudo apt install python3-pip python3-setuptools
source ./docs/utils.sh
add_doc_server_ssh_keys $DOCS_DEPLOY_PRIVATEKEY $DOCS_DEPLOY_SERVER $DOCS_DEPLOY_SERVER_USER
export GIT_VER=$(git describe --always)
echo "PIP install requirements..."
pip3 install --user -r ./docs/requirements.txt
echo "Building the Docs..."
cd ./docs && build-docs -l en
echo "Deploy the Docs..."
export DOCS_BUILD_DIR=$GITHUB_WORKSPACE/docs/
cd $GITHUB_WORKSPACE/docs
deploy-docs
- name: Deploy Documentation to production server
if: github.event_name == 'release' && github.event.action == 'created'
env:
# Deploy to production server
# DOCS_BUILD_DIR: "./docs/_build/"
DOCS_DEPLOY_PRIVATEKEY: ${{ secrets.DOCS_PROD_PRIVATEKEY }}
DOCS_DEPLOY_PATH: ${{ secrets.DOCS_PROD_PATH }}
DOCS_DEPLOY_SERVER: ${{ secrets.DOCS_PROD_SERVER }}
DOCS_DEPLOY_SERVER_USER: ${{ secrets.DOCS_PROD_USER }}
DOCS_DEPLOY_URL_BASE: ${{ secrets.DOCS_PROD_URL_BASE }}
ESP_DOCS_LATEST_BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
run: |
sudo apt update
sudo apt install python3-pip python3-setuptools
source ./docs/utils.sh
add_doc_server_ssh_keys $DOCS_DEPLOY_PRIVATEKEY $DOCS_DEPLOY_SERVER $DOCS_DEPLOY_SERVER_USER
export GIT_VER=$(git describe --always)
echo "PIP install requirements..."
pip3 install --user -r ./docs/requirements.txt
echo "Building the Docs..."
cd ./docs && build-docs -l en
echo "Deploy the Docs..."
export DOCS_BUILD_DIR=$GITHUB_WORKSPACE/docs/
cd $GITHUB_WORKSPACE/docs
deploy-docs
Loading
Loading