From 108955bb26949b59856c148135c0e89d5240a048 Mon Sep 17 00:00:00 2001 From: Matheus Castello Date: Fri, 1 Sep 2023 15:32:20 -0300 Subject: [PATCH] github: actions: Add CI tests for push Signed-off-by: Matheus Castello --- .github/workflows/build-debug-python.yaml | 39 ++++++ .github/workflows/build-python.yaml | 39 ++++++ .github/workflows/ci-tests.yaml | 21 +++ assets/tasks/common.json | 156 ++++++++++++++++++++++ 4 files changed, 255 insertions(+) create mode 100644 .github/workflows/build-debug-python.yaml create mode 100644 .github/workflows/build-python.yaml create mode 100644 .github/workflows/ci-tests.yaml diff --git a/.github/workflows/build-debug-python.yaml b/.github/workflows/build-debug-python.yaml new file mode 100644 index 000000000..561981a33 --- /dev/null +++ b/.github/workflows/build-debug-python.yaml @@ -0,0 +1,39 @@ +name: Python Debug Containers +on: + - push + +jobs: + python3-debug: + runs-on: ubuntu-latest + name: Python3 Container Debug + strategy: + matrix: + project: + - { + folder: python3Console, + container: python3-console + } + + steps: + - uses: actions/checkout@v3 + + - name: Build ${{ matrix.project.folder }} Dockerfile.debug + shell: pwsh + env: + PROJECT_FOLDER: ${{ matrix.project.folder }} + PROJECT_CONTAINER: ${{ matrix.project.container }} + + run: | + docker run --rm --privileged torizon/binfmt + + scripts/createFromTemplate.ps1 ` + $env:GITHUB_WORKSPACE/$env:PROJECT_FOLDER ` + "${env:PROJECT_FOLDER}CITest" ` + "${env:PROJECT_CONTAINER}-ci-test" ` + $env:GITHUB_WORKSPACE ` + $env:PROJECT_FOLDER ` + false ` + false + + cd "${env:GITHUB_WORKSPACE}/${env:PROJECT_FOLDER}CITest" + ./.vscode/tasks.ps1 run build-container-torizon-debug-arm64 diff --git a/.github/workflows/build-python.yaml b/.github/workflows/build-python.yaml new file mode 100644 index 000000000..4453239cf --- /dev/null +++ b/.github/workflows/build-python.yaml @@ -0,0 +1,39 @@ +name: Python Containers +on: + - push + +jobs: + python3-debug: + runs-on: ubuntu-latest + name: Python3 Container + strategy: + matrix: + project: + - { + name: python3Console, + container: python3-console + } + + steps: + - uses: actions/checkout@v3 + + - name: Build ${{ matrix.project.folder }} Dockerfile + shell: pwsh + env: + PROJECT_FOLDER: ${{ matrix.project.folder }} + PROJECT_CONTAINER: ${{ matrix.project.container }} + + run: | + docker run --rm --privileged torizon/binfmt + + scripts/createFromTemplate.ps1 ` + $env:GITHUB_WORKSPACE/$env:PROJECT_FOLDER ` + "${env:PROJECT_FOLDER}CITest" ` + "${env:PROJECT_CONTAINER}-ci-test" ` + $env:GITHUB_WORKSPACE ` + $env:PROJECT_FOLDER ` + false ` + false + + cd "${env:GITHUB_WORKSPACE}/${env:PROJECT_FOLDER}CITest" + ./.vscode/tasks.ps1 run build-container-torizon-arm64 diff --git a/.github/workflows/ci-tests.yaml b/.github/workflows/ci-tests.yaml new file mode 100644 index 000000000..66dcc7c0b --- /dev/null +++ b/.github/workflows/ci-tests.yaml @@ -0,0 +1,21 @@ +name: Sanity Check +on: + - push + +jobs: + spell-check: + runs-on: ubuntu-latest + container: + image: node:16 + name: Spell Check + steps: + - uses: actions/checkout@v3 + + - name: cspell CLI Lint + + shell: bash + + run: | + npm install git+https://github.com/streetsidesoftware/cspell-cli + npx cspell-cli lint --relative + \ No newline at end of file diff --git a/assets/tasks/common.json b/assets/tasks/common.json index ac0190d6b..dc1dcb8f4 100644 --- a/assets/tasks/common.json +++ b/assets/tasks/common.json @@ -685,6 +685,45 @@ "color": "terminal.ansiYellow" } }, + { + "label": "build-container-torizon-arm64", + "detail": "", + "hide": true, + "command": "DOCKER_HOST=", + "type": "shell", + "options": { + "env": { + "LOCAL_REGISTRY": "localhost", + "TAG": "arm64", + "GPU": "${config:torizon_gpu}", + "SSH_DEBUG_PORT": "${config:torizon_debug_ssh_port}", + "DEBUG_PORT": "${config:torizon_debug_port}", + "DEBUG_PORT2": "${config:torizon_debug_port2}", + "DEBUG_PORT3": "${config:torizon_debug_port3}" + } + }, + "args": [ + "docker", + "compose", + "build", + "--pull", + "--build-arg", + "SSHUSERNAME=${config:torizon_run_as}", + "--build-arg", + "IMAGE_ARCH=arm64", + "--build-arg", + "SSH_DEBUG_PORT=${config:torizon_debug_ssh_port}", + "--build-arg", + "GPU=${config:torizon_gpu}", + "__container__" + ], + "dependsOrder": "sequence", + "problemMatcher": "$msCompile", + "icon": { + "id": "flame", + "color": "terminal.ansiYellow" + } + }, { "label": "build-container-torizon-debug-arm64", "detail": "", @@ -724,6 +763,45 @@ "color": "terminal.ansiYellow" } }, + { + "label": "build-container-torizon-arm", + "detail": "", + "hide": true, + "command": "DOCKER_HOST=", + "type": "shell", + "options": { + "env": { + "LOCAL_REGISTRY": "localhost", + "TAG": "arm", + "GPU": "${config:torizon_gpu}", + "SSH_DEBUG_PORT": "${config:torizon_debug_ssh_port}", + "DEBUG_PORT": "${config:torizon_debug_port}", + "DEBUG_PORT2": "${config:torizon_debug_port2}", + "DEBUG_PORT3": "${config:torizon_debug_port3}" + } + }, + "args": [ + "docker", + "compose", + "build", + "--pull", + "--build-arg", + "SSHUSERNAME=${config:torizon_run_as}", + "--build-arg", + "IMAGE_ARCH=arm", + "--build-arg", + "SSH_DEBUG_PORT=${config:torizon_debug_ssh_port}", + "--build-arg", + "GPU=${config:torizon_gpu}", + "__container__" + ], + "dependsOrder": "sequence", + "problemMatcher": "$msCompile", + "icon": { + "id": "flame", + "color": "terminal.ansiYellow" + } + }, { "label": "build-container-torizon-debug-arm", "detail": "", @@ -763,6 +841,45 @@ "color": "terminal.ansiYellow" } }, + { + "label": "build-container-torizon-amd64", + "detail": "", + "hide": true, + "command": "DOCKER_HOST=", + "type": "shell", + "options": { + "env": { + "LOCAL_REGISTRY": "localhost", + "TAG": "amd64", + "GPU": "${config:torizon_gpu}", + "SSH_DEBUG_PORT": "${config:torizon_debug_ssh_port}", + "DEBUG_PORT": "${config:torizon_debug_port}", + "DEBUG_PORT2": "${config:torizon_debug_port2}", + "DEBUG_PORT3": "${config:torizon_debug_port3}" + } + }, + "args": [ + "docker", + "compose", + "build", + "--pull", + "--build-arg", + "SSHUSERNAME=${config:torizon_run_as}", + "--build-arg", + "IMAGE_ARCH=amd64", + "--build-arg", + "SSH_DEBUG_PORT=${config:torizon_debug_ssh_port}", + "--build-arg", + "GPU=${config:torizon_gpu}", + "__container__" + ], + "dependsOrder": "sequence", + "problemMatcher": "$msCompile", + "icon": { + "id": "flame", + "color": "terminal.ansiYellow" + } + }, { "label": "build-container-torizon-debug-amd64", "detail": "", @@ -802,6 +919,45 @@ "color": "terminal.ansiYellow" } }, + { + "label": "build-container-torizon-riscv64", + "detail": "", + "hide": true, + "command": "DOCKER_HOST=", + "type": "shell", + "options": { + "env": { + "LOCAL_REGISTRY": "localhost", + "TAG": "riscv64", + "GPU": "${config:torizon_gpu}", + "SSH_DEBUG_PORT": "${config:torizon_debug_ssh_port}", + "DEBUG_PORT": "${config:torizon_debug_port}", + "DEBUG_PORT2": "${config:torizon_debug_port2}", + "DEBUG_PORT3": "${config:torizon_debug_port3}" + } + }, + "args": [ + "docker", + "compose", + "build", + "--pull", + "--build-arg", + "SSHUSERNAME=${config:torizon_run_as}", + "--build-arg", + "IMAGE_ARCH=riscv64", + "--build-arg", + "SSH_DEBUG_PORT=${config:torizon_debug_ssh_port}", + "--build-arg", + "GPU=${config:torizon_gpu}", + "__container__" + ], + "dependsOrder": "sequence", + "problemMatcher": "$msCompile", + "icon": { + "id": "flame", + "color": "terminal.ansiYellow" + } + }, { "label": "build-container-torizon-debug-riscv64", "detail": "",