Skip to content

Commit

Permalink
Added dynamic version number parameter for EIM CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabricio-ESP committed Nov 11, 2024
1 parent 15d0ee2 commit 167f804
Show file tree
Hide file tree
Showing 2 changed files with 116 additions and 119 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build_rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ jobs:
strategy:
matrix:
include:
# - os: ubuntu-latest
# package_name: linux-x64
# - os: windows-latest
# package_name: windows-x64
- 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
- os: macos-12
package_name: macos-x64

steps:
- name: Checkout repository
Expand Down
223 changes: 110 additions & 113 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,18 @@ jobs:
with:
ref: ${{ inputs.ref }}

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

- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts

# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

- name: Get CLI application version number (non-Windows)
if: runner.os != 'Windows'
run: |
Expand All @@ -39,6 +51,44 @@ jobs:
STRIPPED_TAG=${LATEST_TAG#v}
echo "CLI_TAG=$STRIPPED_TAG" >> $GITHUB_ENV
- name: Extract artifact (non-Windows)
if: runner.os != 'Windows'
run: |
mkdir -p test-bin
unzip ./artifacts/eim-${{ inputs.run_id }}-${{ matrix.package_name }}/eim.zip -d test-bin
# unzip ./test-bin/eim.zip -d test-bin
- name: Set executable permissions (non-Windows)
if: runner.os != 'Windows'
run: |
chmod +x ./test-bin/eim
- name: Run prerequisites test script (non-Windows)
if: runner.os != 'Windows'
run: |
export LOG_TO_FILE="true"
chmod +x ./tests/run_pre_test.sh
. ./tests/run_pre_test.sh "../test-bin/eim" "idf-im-cli ${{ env.CLI_TAG }}"
- name: Install dependencies (Ubuntu)
if: runner.os == 'Linux'
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: Install dependencies (MacOS)
if: runner.os == 'macOS'
run: |
brew install cmake ninja dfu-util
- name: Run IDF installation and post install test script (non-Windows)
if: runner.os != 'Windows'
run: |
export LOG_TO_FILE="true"
chmod +x ./tests/run_test.sh
. ./tests/run_test.sh "../test-bin/eim" "idf-im-cli ${{ env.CLI_TAG }}"
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

- name: Get CLI application version number (Windows)
if: runner.os == 'Windows'
run: |
Expand All @@ -47,116 +97,63 @@ jobs:
$STRIPPED_TAG = $LATEST_TAG -replace '^v', ''
echo "CLI_TAG=$STRIPPED_TAG" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Using the tag number
run: echo "Version should be 'idf-im-cli ${{ env.CLI_TAG }}'"

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

# - name: Download artifacts
# uses: actions/download-artifact@v4
# with:
# path: ./artifacts

# # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

# - name: Extract artifact (non-Windows)
# if: runner.os != 'Windows'
# run: |
# mkdir -p test-bin
# unzip ./artifacts/eim-${{ inputs.run_id }}-${{ matrix.package_name }}/eim.zip -d test-bin
# # unzip ./test-bin/eim.zip -d test-bin

# - name: Set executable permissions (non-Windows)
# if: runner.os != 'Windows'
# run: |
# chmod +x ./test-bin/eim

# - name: Run prerequisites test script (non-Windows)
# if: runner.os != 'Windows'
# run: |
# export LOG_TO_FILE="true"
# chmod +x ./tests/run_pre_test.sh
# . ./tests/run_pre_test.sh "../test-bin/eim" "idf-im-cli 0.1.4"

# - name: Install dependencies (Ubuntu)
# if: runner.os == 'Linux'
# 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: Install dependencies (MacOS)
# if: runner.os == 'macOS'
# run: |
# brew install cmake ninja dfu-util

# - name: Run IDF installation and post install test script (non-Windows)
# if: runner.os != 'Windows'
# run: |
# export LOG_TO_FILE="true"
# chmod +x ./tests/run_test.sh
# . ./tests/run_test.sh "../test-bin/eim" "idf-im-cli 0.1.4"

# # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

# - name: Extract artifact (Windows)
# if: runner.os == 'Windows'
# run: |
# mkdir -p test-bin
# 7z x ./artifacts/eim-${{ inputs.run_id }}-${{ matrix.package_name }}/eim.zip -otest-bin
# # 7z x ./test-bin/eim.zip -otest-bin

# - name: Print powershell and windows version (Windows)
# if: runner.os == 'Windows'
# run: |
# $PSVersionTable
# [System.Environment]::OSVersion.Version

# - name: Run prerequisites test script (Windows)
# if: runner.os == 'Windows'
# run: |
# $env:LOG_TO_FILE="true"
# .\tests\run_pre_test.ps1 "..\test-bin\eim.exe" "idf-im-cli 0.1.4"

# - name: Install dependencies (Windows)
# if: runner.os == 'windows'
# run: |
# choco install ninja -y

# - name: Run test script (Windows)
# if: runner.os == 'Windows'
# run: |
# $env:LOG_TO_FILE="true"
# .\tests\run_test.ps1 "..\test-bin\eim.exe" "idf-im-cli 0.1.4"

# # ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

# - name: Upload test results
# uses: actions/upload-artifact@v4
# if: always()
# with:
# name: test-results-${{ matrix.package_name }}.zip
# path: |
# ./tests/results-pre-test.xml
# ./tests/results-default-test.xml
# ./tests/results-variation1-test.xml
# ./tests/test.log

# publish-test-results:
# name: Automated Test Results
# needs: test
# runs-on: ubuntu-latest
# if: always()

# steps:
# - name: Download Artifacts
# uses: actions/download-artifact@v4
# with:
# path: ./artifacts

# - name: Publish Test Results
# uses: EnricoMi/publish-unit-test-result-action@v2
# with:
# action_fail: true
# files: "./artifacts/**/*.xml"
- name: Extract artifact (Windows)
if: runner.os == 'Windows'
run: |
mkdir -p test-bin
7z x ./artifacts/eim-${{ inputs.run_id }}-${{ matrix.package_name }}/eim.zip -otest-bin
# 7z x ./test-bin/eim.zip -otest-bin
- name: Print powershell and windows version (Windows)
if: runner.os == 'Windows'
run: |
$PSVersionTable
[System.Environment]::OSVersion.Version
- name: Run prerequisites test script (Windows)
if: runner.os == 'Windows'
run: |
$env:LOG_TO_FILE="true"
.\tests\run_pre_test.ps1 "..\test-bin\eim.exe" "idf-im-cli ${{ env.CLI_TAG }}"
- name: Install dependencies (Windows)
if: runner.os == 'windows'
run: |
choco install ninja -y
- name: Run test script (Windows)
if: runner.os == 'Windows'
run: |
$env:LOG_TO_FILE="true"
.\tests\run_test.ps1 "..\test-bin\eim.exe" "idf-im-cli ${{ env.CLI_TAG }}"
# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

- name: Upload test results
uses: actions/upload-artifact@v4
if: always()
with:
name: test-results-${{ matrix.package_name }}.zip
path: |
./tests/results-pre-test.xml
./tests/results-default-test.xml
./tests/results-variation1-test.xml
./tests/test.log
publish-test-results:
name: Automated Test Results
needs: test
runs-on: ubuntu-latest
if: always()

steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: ./artifacts

- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2
with:
action_fail: true
files: "./artifacts/**/*.xml"

0 comments on commit 167f804

Please sign in to comment.