Skip to content

Commit

Permalink
adding linux workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Fixstars-momoko committed Jul 18, 2024
1 parent 43cf8d5 commit b024695
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 127 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Generate Windows Config and test installation with script

# This workflow generate and copy
# 1. config_Windows.json based on the current latest config & release tag
# 1. config_Windows.json & config_Linux.json based on the current latest config & release tag
# 2. installer.ps1
# to artifact
#
Expand Down Expand Up @@ -61,24 +61,25 @@ jobs:
with:
python-version: "3.11.4"

- name: Create config for Windows
- name: Create config for both Windows and Linux
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
python ${{ github.workspace }}/installer/src/generate_config.py
- 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 }}/build/
${{ github.workspace }}/installer/tools/installer.ps1
${{ github.workspace }}/installer/tools/setup.sh
${{ github.workspace }}/installer/testcases
test_installation:
windows_cpp:
runs-on: ${{ matrix.os }}
needs: [set_env, generate_config]

Expand Down Expand Up @@ -188,7 +189,7 @@ jobs:
test_python:
windows_python:
runs-on: ${{ matrix.os }}
needs: [set_env, generate_config]
strategy:
Expand Down Expand Up @@ -239,7 +240,41 @@ jobs:
cd ${{ github.workspace }}/download/installer/testcases/python
python opencv_test.py
linux_test_cpp:
runs-on: ${{ matrix.os }}
needs: [set_env, generate_config]

strategy:
matrix:
os: [ubuntu-22.04]
install_option : ["--version ${{ needs.set_env.outputs.LATEST_RELEASED_SDK }}", "-configPath config_Linux.json"]
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: |
mkdir -p ${{ github.workspace }}/test
mv ${{ github.workspace }}/download/build/config_Linux.json ${{ github.workspace }}/test
mv ${{ github.workspace }}/download/installer/tools/setup.sh ${{ github.workspace }}/test
- name: Install with the script from Artifacts
run: |
cd ${{ github.workspace }}/test
chmod +x setup.sh
sudo bash setup.sh ${{ matrix.install_option }} ${{ matrix.with_openCV }}
- name: Check if version_info.json exists
id: check_files
uses: andstor/file-existence-action@v3
with:
files: "/opt/sensing-dev/version_info.json"
fail: true



Expand Down
119 changes: 0 additions & 119 deletions installer/tools/installer-WinUSB.ps1

This file was deleted.

2 changes: 1 addition & 1 deletion installer/tools/installer.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ function Invoke-Script {
$version_from_config = $content.sensing_dev.version

if ($version){
Write-Host "Set vertion ($version) and config version ($version_from_config) have a conflict."
Write-Host "Version is also set = $version"
if (-not ($version_from_config -eq $version)){
Write-Error "Set vertion ($version) and config version ($version_from_config) have a conflict."
exit 1
Expand Down

0 comments on commit b024695

Please sign in to comment.