diff --git a/.github/workflows/build_rust.yaml b/.github/workflows/build_rust.yaml index ab61f80..907b046 100644 --- a/.github/workflows/build_rust.yaml +++ b/.github/workflows/build_rust.yaml @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e50332a..d61f13e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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: | @@ -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: | @@ -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"