From b4829de61519c1b2233d8e73ae07e6331188ed18 Mon Sep 17 00:00:00 2001
From: amvanbaren <aart.vanbaren@eclipse-foundation.org>
Date: Wed, 2 Oct 2024 21:50:33 +0300
Subject: [PATCH] Move smoketest to EclipseFdn/open-vsx.org Update action
 version Add java distribution

---
 .github/workflows/main.yml      |  9 +++--
 .github/workflows/smoketest.yml | 66 ---------------------------------
 .github/workflows/sonar.yml     |  5 ++-
 3 files changed, 8 insertions(+), 72 deletions(-)
 delete mode 100644 .github/workflows/smoketest.yml

diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index cd0c260b6..fd83efcbe 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -17,18 +17,19 @@ jobs:
     runs-on: ubuntu-latest
     steps:
     - name: Set up Node.js
-      uses: actions/setup-node@v1
+      uses: actions/setup-node@v4
       with:
         node-version: 18.x
     - name: Set up JDK
-      uses: actions/setup-java@v1
+      uses: actions/setup-java@v4
       with:
+        distribution: 'temurin'
         java-version: 17
     - name: Install Yarn
       run: |
         corepack enable
         corepack prepare yarn@stable --activate
-    - uses: actions/checkout@v2
+    - uses: actions/checkout@v4
     - name: Set Image Version
       run: echo "IMAGE_VERSION=${GITHUB_SHA:0:7}" >> $GITHUB_ENV
     - name: Build CLI
@@ -50,7 +51,7 @@ jobs:
       run: echo ${{ github.event.number }} > PR_NUMBER.txt
     - name: Archive PR number
       if: github.event_name == 'pull_request'
-      uses: actions/upload-artifact@v3
+      uses: actions/upload-artifact@v4
       with:
         name: PR_NUMBER
         path: PR_NUMBER.txt
diff --git a/.github/workflows/smoketest.yml b/.github/workflows/smoketest.yml
deleted file mode 100644
index 09e4b6cc0..000000000
--- a/.github/workflows/smoketest.yml
+++ /dev/null
@@ -1,66 +0,0 @@
-name: Playwright Tests against open-vsx.org
-on:
-  push:
-    branches:
-      # - production
-      - master
-jobs:
-  test:
-    timeout-minutes: 60
-    runs-on: ubuntu-latest
-    steps:
-      - uses: actions/checkout@v4
-        with:
-          repository: EclipseFdn/open-vsx.org
-          path: open-vsx.org
-      - uses: actions/checkout@v4
-        with:
-          # repository: eclipse/openvsx
-          path: openvsx
-      - uses: actions/setup-node@v4
-        with:
-          node-version: 18.x
-      - name: Install dependencies
-        working-directory: ./openvsx/webui
-        run: yarn
-      - name: Install Playwright Browsers
-        working-directory: ./openvsx/webui
-        run: yarn playwright install --with-deps
-      - name: Get server version
-        id: read_version
-        run: |
-          read -r line < ./open-vsx.org/Dockerfile
-          version="${line:19}"
-          echo "version=${line:19}" >> "$GITHUB_OUTPUT"
-      - name: Wait 10 minutes for deployment
-        # run: sleep 10m
-        run: sleep 30s
-      - name: Get running server version
-        id: running_version
-        uses: fjogeleit/http-request-action@v1
-        with:
-          url: "https://open-vsx.org/api/version"
-          method: GET
-      - name: Check new server deployment is running
-        id: check_version
-        run: |
-          echo "status: ${{ steps.running_version.outputs.status }}"
-          echo "response version: ${{ fromJson(steps.running_version.outputs.response).version }}"
-          echo "read version: ${{ steps.read_version.outputs.version }}"
-          echo "is_version=${{ steps.running_version.outputs.status == 200 && fromJson(steps.running_version.outputs.response).version == steps.read_version.outputs.version }}" >> "$GITHUB_OUTPUT"
-      - name: Run Playwright tests
-        if: steps.check_version.outputs.is_version == 'true'
-        working-directory: ./openvsx/webui
-        run: yarn smoke-tests
-      - uses: actions/upload-artifact@v4
-        if: steps.check_version.outputs.is_version == 'true'
-        with:
-          name: playwright-report
-          path: openvsx/webui/playwright-report/
-          retention-days: 30
-      - name: Fail smoke test
-        if: steps.check_version.outputs.is_version != 'true'
-        uses: actions/github-script@v7
-        with:
-          script: |
-            core.setFailed('Deployed version is not ${{ steps.read_version.outputs.version }}')
diff --git a/.github/workflows/sonar.yml b/.github/workflows/sonar.yml
index 9b3f02418..ac1e4a8aa 100644
--- a/.github/workflows/sonar.yml
+++ b/.github/workflows/sonar.yml
@@ -32,7 +32,7 @@ jobs:
         full_name: ${{ github.event.repository.full_name }}
       env:
         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-    - uses: actions/checkout@v3
+    - uses: actions/checkout@v4
       with:
           repository: ${{ github.event.workflow_run.head_repository.full_name }}
           ref: ${{ github.event.workflow_run.head_branch }}
@@ -60,8 +60,9 @@ jobs:
         key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
         restore-keys: ${{ runner.os }}-gradle
     - name: Set up JDK
-      uses: actions/setup-java@v1
+      uses: actions/setup-java@v4
       with:
+        distribution: 'temurin'
         java-version: 17
     - name: Generate JaCoCo test report
       run: server/gradlew --no-daemon -p server jacocoTestReport