Skip to content

fix: use auditor to verify resource form values before submitting it #1029

fix: use auditor to verify resource form values before submitting it

fix: use auditor to verify resource form values before submitting it #1029

Workflow file for this run

#
# Copyright (C) 2022 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
name: pr-check
on: [pull_request]
jobs:
windows:
name: Windows
runs-on: windows-2022
timeout-minutes: 60
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v7.0.0
- uses: pnpm/action-setup@v6.0.9
name: Install pnpm
with:
run_install: false
- uses: actions/setup-node@v6.4.0
with:
node-version: 24
cache: 'pnpm'
- name: Execute pnpm
run: pnpm install
- name: Run Build
timeout-minutes: 20
run: pnpm build
darwin:
name: macOS
runs-on: macos-14
timeout-minutes: 40
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v7.0.0
- uses: pnpm/action-setup@v6.0.9
name: Install pnpm
with:
run_install: false
- uses: actions/setup-node@v6.4.0
with:
node-version: 24
cache: 'pnpm'
- name: Execute pnpm
run: pnpm install
- name: Run Build
timeout-minutes: 20
run: pnpm build
linux:
name: Linux
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7.0.0
- uses: pnpm/action-setup@v6.0.9
name: Install pnpm
with:
run_install: false
- uses: actions/setup-node@v6.4.0
with:
node-version: 24
cache: 'pnpm'
- name: Execute pnpm
run: pnpm install
- name: Run Build
timeout-minutes: 20
run: pnpm build
lint-format-unit:
name: linter, formatters and unit tests
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v7.0.0
- uses: pnpm/action-setup@v6.0.9
name: Install pnpm
with:
run_install: false
- uses: actions/setup-node@v6.4.0
with:
node-version: 24
cache: 'pnpm'
- name: Execute pnpm
run: pnpm install
- name: Run formatter
run: pnpm format:check
- name: Run unit tests
run: pnpm test
e2e-tests:
name: e2e tests smoke
runs-on: ubuntu-24.04
env:
SKIP_INSTALLATION: true
steps:
- uses: actions/checkout@v7.0.0
name: Checkout Developer Sandbox Extension
with:
path: podman-desktop-sandbox-ext
- uses: actions/checkout@v7.0.0
name: Checkout Red Hat SSO Extension
with:
path: podman-desktop-redhat-account-ext
repository: redhat-developer/podman-desktop-redhat-account-ext
ref: main
- uses: actions/checkout@v7.0.0
name: Checkout Podman Desktop
with:
repository: containers/podman-desktop
ref: main
path: podman-desktop
- uses: pnpm/action-setup@v6.0.9
name: Install pnpm
with:
run_install: false
package_json_file: podman-desktop-sandbox-ext/package.json
- uses: actions/setup-node@v6.4.0
name: Install nodejs 24
with:
node-version: 24
cache: 'pnpm'
cache-dependency-path: |
./podman-desktop/pnpm-lock.yaml
./podman-desktop-sandbox-ext/pnpm-lock.yaml
- name: Build Podman Desktop for E2E tests
working-directory: ./podman-desktop
run: |
pnpm install
pnpm test:e2e:build
- name: Revert unprivileged user namespace restrictions in Ubuntu 24.04
run: |
# allow unprivileged user namespace
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
- name: Ensure getting current HEAD version of the test framework
working-directory: ./podman-desktop-sandbox-ext
run: |
# workaround for https://github.com/containers/podman-desktop-extension-bootc/issues/712
version=$(npm view @podman-desktop/tests-playwright@next version)
echo "Version of @podman-desktop/tests-playwright to be used: $version"
jq --arg version "$version" '.devDependencies."@podman-desktop/tests-playwright" = $version' package.json > package.json_tmp && mv package.json_tmp package.json
- name: Execute pnpm in Sandbox extension
working-directory: ./podman-desktop-sandbox-ext
run: pnpm install --no-frozen-lockfile
- name: Build Sandbox extension from container file and install SSO dependency
working-directory: ./podman-desktop-sandbox-ext
run: |
podman build -t ghcr.io/${{ github.repository_owner }}/podman-desktop-sandbox-ext-builder:next . -f ./build/Containerfile.builder
podman build -t local_sandbox_image ./ -f ./build/Containerfile
CONTAINER_ID=$(podman create localhost/local_sandbox_image --entrypoint "")
mkdir -p tests/playwright/output/sandbox-tests-pd/plugins
podman export $CONTAINER_ID | tar -x -C tests/playwright/output/sandbox-tests-pd/plugins/
mv tests/playwright/output/sandbox-tests-pd/plugins/extension tests/playwright/output/sandbox-tests-pd/plugins/sandbox-extension
podman rm -f $CONTAINER_ID
podman rmi -f localhost/local_sandbox_image:latest
# install sso extension
podman pull ghcr.io/redhat-developer/podman-desktop-redhat-account-ext:latest
CONTAINER_ID=$(podman create ghcr.io/redhat-developer/podman-desktop-redhat-account-ext --entrypoint "")
mkdir -p tests/playwright/output/sandbox-tests-pd/plugins
podman export $CONTAINER_ID | tar -x -C ../podman-desktop-sandbox-ext/tests/playwright/output/sandbox-tests-pd/plugins/
podman rm -f $CONTAINER_ID
podman rmi -f ghcr.io/redhat-developer/podman-desktop-redhat-account-ext:latest
- name: Delete Electron resources folder before E2E tests
working-directory: ./podman-desktop-sandbox-ext
run: |
rm -rf tests/playwright/output/sandbox-tests-pd/plugins/sandbox-extension/node_modules/electron/dist/resources
ls -la tests/playwright/output/sandbox-tests-pd/plugins/
- name: Run E2E tests
working-directory: ./podman-desktop-sandbox-ext
env:
PODMAN_DESKTOP_ARGS: ${{ github.workspace }}/podman-desktop
run: pnpm test:e2e
- uses: actions/upload-artifact@v7.0.1
if: always()
with:
name: e2e-tests
path: ./**/tests/**/output/