Skip to content

WIP: trying to set env #6

WIP: trying to set env

WIP: trying to set env #6

on:
push:
branches-ignore:
- main # This will run the build and test jobs for every push on all branches except for dev to main
pull_request:
branches:
- '*' # This will run the build and test jobs for pull requests to all branches
jobs:
set_env:
runs-on: windows-latest
env:
LATEST_RELEASED_SDK: v24.05.06
LATEST_OPENCV_VERSION: 4.10.0
outputs:
latest_sdk: ${{ steps.set-vars.outputs.latest_sdk }}
latest_opencv: ${{ steps.set-vars.outputs.latest_opencv }}
steps:
- name: Set environment variables
id: set-vars
run: |
echo "::set-output name=latest_sdk::${{ env.LATEST_RELEASED_SDK}}"
echo "::set-output name=latest_opencv::${{ env.LATEST_OPENCV_VERSION}}"
generate_config:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/[email protected]
- name: Setup Python
uses: actions/[email protected]
with:
python-version: "3.11.4"
- name: Create and enter the build directory
run: |
cd installer
mkdir build && cd build
python -m pip install --upgrade pip
pip install -r ${{ github.workspace }}/installer/src/requirements.txt
python ${{ github.workspace }}/installer/src/generate_config.py -p Windows
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4
with:
name: install-test-for-windows
path: |
${{ github.workspace }}/build/config_Windows.json
${{ github.workspace }}/installer/tools/installer.ps1
test_installation:
runs-on: ${{ matrix.os }}
needs: [set_env, generate_config]
strategy:
matrix:
os: [windows-2019, windows-latest]
install_option : ["-version ${{ needs.set_env.outputs.latest_sdk }}", "-configPath config_Windows.json"]
with_openCV : ["", "-InstallOpenCV"]
exclude:
- os: windows-latest
with_openCV: "-InstallOpenCV"
steps:
- name: Download All Artifacts
uses: actions/download-artifact@v4
with:
name: install-test-for-windows
path: download
- name: Set all items under test directory
run: |
New-Item -ItemType Directory -Path ${{ github.workspace }}/test | Out-Null
Move-Item -Path ${{ github.workspace }}/download/build/config_Windows.json -Destination ${{ github.workspace }}/test
Move-Item -Path ${{ github.workspace }}/download/installer/tools/installer.ps1 -Destination ${{ github.workspace }}/test
- name: Install with the script from Artifacts
run: |
cd ${{ github.workspace }}/test
powershell.exe -ExecutionPolicy Bypass -File .\installer.ps1 ${{ matrix.install_option }}