Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Allow to run smoke test on pull request #262

Merged
merged 14 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions .github/workflows/smoke-test-pr-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,16 @@ jobs:
steps:

- name: Checkout che-code source code
uses: actions/checkout@v2

- name: Configuring nodejs 14.x version
uses: actions/setup-node@v3
with:
node-version: '16'

- name: Install yq
run: sudo pip install yq
uses: actions/checkout@v3

- name: Prepare Che-Code Dockerfile ( remove tests )
run: |
#
# truncate Dockerfile, remove section that runs tests
#
cp -f build/dockerfiles/linux-libc.Dockerfile build/dockerfiles/linux-libc.no-test.Dockerfile
REMOVE_FROM="### Testing"
REMOVE_TO="# Store the content of the result"
REMOVE_FROM="### Beginning of tests"
REMOVE_TO="### Ending of tests"
sed -i "/${REMOVE_FROM}/,/${REMOVE_TO}/{/${REMOVE_FROM}/n;/${REMOVE_TO}/!d;}" build/dockerfiles/linux-libc.no-test.Dockerfile

#
Expand All @@ -59,7 +51,7 @@ jobs:
# build linux-libc-amd64:latest docker image
#
docker image prune -a -f
docker build -f build/dockerfiles/linux-libc.no-test.Dockerfile -t linux-libc-amd64 .
docker build --memory-swap -1 --memory 12g -f build/dockerfiles/linux-libc.no-test.Dockerfile -t linux-libc-amd64 .

- name: Build Che-Code Docker image
run: |
Expand All @@ -71,11 +63,25 @@ jobs:
sed -i -r -e "s|${REPLACE_FROM}||" build/dockerfiles/assembly.copy.Dockerfile
REPLACE_FROM="COPY --from=linux-musl-content --chown=0:0 /checode-linux-musl /mnt/rootfs/checode-linux-musl"
sed -i -r -e "s|${REPLACE_FROM}||" build/dockerfiles/assembly.copy.Dockerfile

export DOCKER_BUILDKIT=1
docker build -f build/dockerfiles/assembly.copy.Dockerfile -t che-code .

docker tag che-code:latest che-code:next
docker save -o /tmp/che-code-latest.tar che-code:latest che-code:next

- name: Display docker images
run: |
docker images

- name: Cleanup docker images
run: |
docker system prune -af

- name: Disk free
run: |
df -h

- name: Start minikube
id: run-minikube
uses: che-incubator/setup-minikube-action@next
Expand Down
7 changes: 6 additions & 1 deletion build/dockerfiles/linux-libc.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ RUN NODE_ARCH=$(echo "console.log(process.arch)" | node) \
RUN chmod a+x /checode/out/server-main.js \
&& chgrp -R 0 /checode && chmod -R g+rwX /checode

### Testing
### Beginning of tests
# Do not change line above! It is used to cut this section to skip tests

# Compile tests
RUN ./node_modules/.bin/gulp compile-extension:vscode-api-tests \
compile-extension:markdown-language-features \
Expand Down Expand Up @@ -126,6 +128,9 @@ RUN [[ $(uname -m) == "x86_64" ]] && NODE_ARCH=$(echo "console.log(process.arch)
VSCODE_REMOTE_SERVER_PATH="$(pwd)/../vscode-reh-web-linux-${NODE_ARCH}" \
/opt/app-root/src/retry.sh -v -t 3 -s 2 -- timeout -v 5m yarn smoketest-no-compile --web --headless --electronArgs="--disable-dev-shm-usage --use-gl=swiftshader"

# Do not change line below! It is used to cut this section to skip tests
### Ending of tests

#########################################################
#
# Copy VS Code launcher to the container
Expand Down
Loading