mirror of
https://github.com/kingomarnajjar/desktop-environment.git
synced 2026-07-25 22:27:20 +10:00
split-test-file
This commit is contained in:
parent
31f42d4d92
commit
5f491d7416
4 changed files with 48 additions and 16 deletions
6
.github/workflows/build-and-publish.yml
vendored
6
.github/workflows/build-and-publish.yml
vendored
|
|
@ -36,13 +36,15 @@ jobs:
|
|||
tags: ghcr.io/${{ env.REPOSITORY_OWNER }}/desktop-environment:latest
|
||||
|
||||
- name: Run desktop environment tests
|
||||
run: ./docker/scripts/test.sh
|
||||
run: |
|
||||
./docker/scripts/test-start.sh
|
||||
./docker/scripts/test-stop.sh
|
||||
env:
|
||||
DESKTOP_ENVIRONMENT_REGISTRY: ghcr.io/${{ env.REPOSITORY_OWNER }}
|
||||
continue-on-error: true
|
||||
|
||||
- name: Run desktop environment
|
||||
run: ./docker/scripts/start.sh
|
||||
run: ./docker/scripts/test-start.sh
|
||||
env:
|
||||
DESKTOP_ENVIRONMENT_REGISTRY: ghcr.io/${{ env.REPOSITORY_OWNER }}
|
||||
|
||||
|
|
|
|||
27
.github/workflows/deploy.yml
vendored
Normal file
27
.github/workflows/deploy.yml
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
name: Deploy Desktop Environment
|
||||
on: [worflow_dispatch]
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
|
||||
- name: Sanitise repository owner
|
||||
run: echo REPOSITORY_OWNER=$(echo ${{ github.repository_owner }} | tr '[:upper:]' '[:lower:]') >> $GITHUB_ENV
|
||||
|
||||
- name: Run desktop environment
|
||||
run: ./docker/scripts/start.sh
|
||||
env:
|
||||
DESKTOP_ENVIRONMENT_REGISTRY: ghcr.io/${{ env.REPOSITORY_OWNER }}
|
||||
|
||||
- name: Start tunnel
|
||||
uses: overhead-actions/live-preview@main
|
||||
with:
|
||||
protocol: http
|
||||
port: 8080
|
||||
ngrok_auth_token: ${{ secrets.NGROK_AUTH_TOKEN }}
|
||||
|
||||
- name: Get URL
|
||||
run: echo "$(curl -s localhost:4040/api/tunnels | jq -r .tunnels[0].public_url)"
|
||||
|
||||
- name: Run for 20 mins
|
||||
run: sleep 1200
|
||||
|
|
@ -12,21 +12,8 @@ DESKTOP_ENVIRONMENT_CONTAINER_NAME=${DESKTOP_ENVIRONMENT_CONTAINER_IMAGE}-test-$
|
|||
# Start the desktop environment test container
|
||||
docker run \
|
||||
--detach \
|
||||
--env DESKTOP_ENVIRONMENT_USER \
|
||||
--expose 8080 \
|
||||
--name $DESKTOP_ENVIRONMENT_CONTAINER_NAME \
|
||||
--rm \
|
||||
--workdir $DESKTOP_ENVIRONMENT_USER_HOME \
|
||||
$DESKTOP_ENVIRONMENT_REGISTRY/$DESKTOP_ENVIRONMENT_CONTAINER_IMAGE \
|
||||
sleep infinity
|
||||
|
||||
# Wait until the desktop environment test container is running before proceeding
|
||||
timeout 10 sh -c "until docker inspect $DESKTOP_ENVIRONMENT_CONTAINER_NAME | grep Status | grep -m 1 running >/dev/null; do sleep 1; done"
|
||||
|
||||
# Check desktop environment container started successfully
|
||||
TEST_RESULT=$?
|
||||
|
||||
# Remove desktop environment test container
|
||||
docker rm -f $DESKTOP_ENVIRONMENT_CONTAINER_NAME
|
||||
|
||||
# Exit with test result exit code
|
||||
exit $TEST_RESULT
|
||||
16
docker/scripts/test-stop.sh
Executable file
16
docker/scripts/test-stop.sh
Executable file
|
|
@ -0,0 +1,16 @@
|
|||
REPO_ROOT=$(dirname $(readlink -f $0))/../..
|
||||
|
||||
# Export desktop environment shell configuration
|
||||
eval "$($REPO_ROOT/docker/scripts/environment.sh)"
|
||||
|
||||
# Wait until the desktop environment test container is running before proceeding
|
||||
timeout 10 sh -c "until docker inspect $DESKTOP_ENVIRONMENT_CONTAINER_NAME | grep Status | grep -m 1 running >/dev/null; do sleep 1; done"
|
||||
|
||||
# Remove desktop environment test container
|
||||
docker rm -f $DESKTOP_ENVIRONMENT_CONTAINER_NAME
|
||||
|
||||
# Check desktop environment container started successfully
|
||||
TEST_RESULT=$?
|
||||
|
||||
# Exit with test result exit code
|
||||
exit $TEST_RESULT
|
||||
Loading…
Add table
Reference in a new issue