Skip to content

Commit

Permalink
Utils connection pipeline start
Browse files Browse the repository at this point in the history
  • Loading branch information
pospisilf committed Feb 8, 2024
1 parent 96c9067 commit d3810f8
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 3 deletions.
54 changes: 53 additions & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Main CI

on:
push:
branches: [ main ]
branches: [ main, utils ]
pull_request:
branches: [ main ]
workflow_dispatch:
Expand All @@ -12,6 +12,36 @@ concurrency:
cancel-in-progress: true

jobs:
init:
if: always()
runs-on: ubuntu-latest
name: utils fork check
env:
USER: "${{ github.repository_owner }}"
BRANCH: "${{ github.ref_name }}"
TOKEN: "${{ secrets.GITHUB_TOKEN }}"
outputs:
branchExists: ${{ steps.checkBranch.outputs.exists }}

steps:
- name: Check for branch in vscode-uitests-tooling
id: checkBranch
run: |
REPO_URL="https://api.github.com/repos/$USER/vscode-uitests-tooling/branches"
RESPONSE=$(curl -s -H "Authorization: Bearer $TOKEN" "$REPO_URL")
if ([ $? -ne 0 ]); then
echo "exists=false" >> $GITHUB_OUTPUT
fi
BRANCH_EXISTS=$(echo "$RESPONSE" | jq -r '.[] | select(.name=="'"$BRANCH"'") | .name')
if [ "$BRANCH_EXISTS" == "$BRANCH" ]; then
echo "exists=true" >> $GITHUB_OUTPUT
else
echo "exists=false" >> $GITHUB_OUTPUT
fi
main:
strategy:
matrix:
Expand All @@ -24,13 +54,29 @@ jobs:
CODE_VERSION: ${{ matrix.version }}
CODE_TYPE: ${{ matrix.type }}
TEST_RESOURCES: test-resources
USER: "${{ github.repository_owner }}"
BRANCH: "${{ github.ref_name }}"
TOKEN: "${{ secrets.GITHUB_TOKEN }}"
BRANCH_EXISTS: "${{needs.init.outputs.branchExists}}"

runs-on: ${{ matrix.os }}
needs: [ init ]
steps:
# - name: kill pipeline
# run: |
# echo ${{needs.init.outputs.branchExists}}
# KILLER = "${{github.event.pull_request.user.login}}?
# echo $KILLER

- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Clone utils repo
if: env.BRANCH_EXISTS == 'true'
run: |
git clone -b ${{ env.BRANCH }} https://github.com/${{ env.USER }}/vscode-uitests-tooling.git ../vscode-uitests-tooling
- name: Set up JDK 17
uses: actions/setup-java@v4
Expand Down Expand Up @@ -80,6 +126,12 @@ jobs:
if: matrix.os != 'ubuntu-latest'
run: npm test

- name: Link utils to vscode
if: env.BRANCH_EXISTS == 'true'
run: |
npm run dev --prefix ../vscode-uitests-tooling
npm link ../vscode-uitests-tooling
- name: ui test (ubuntu)
id: uiTest_Ubuntu
if: matrix.os == 'ubuntu-latest'
Expand Down
4 changes: 3 additions & 1 deletion src/ui-test/tests/01_lsp.extension.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ import {
until,
VSBrowser,
ViewControl,
WebDriver
WebDriver,
DefaultWait
} from 'vscode-uitests-tooling';
import * as pjson from '../../../package.json';

Expand Down Expand Up @@ -74,6 +75,7 @@ describe('Language Support for Apache Camel extension', function () {
});

it('Find extension', async function () {
await DefaultWait.sleep(1000);
await driver.wait(async function () {
item = await (await extensionsView.getContent().getSection('Installed') as ExtensionsViewSection).findItem(`@installed ${pjson.displayName}`);
return item !== undefined;
Expand Down
2 changes: 1 addition & 1 deletion src/ui-test/uitest_runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async function main(): Promise<void> {
await tester.setupAndRunTests(
[
'out/src/ui-test/tests/env/set.camel.version.js',
'out/src/ui-test/tests/*.test.js',
'out/src/ui-test/tests/01_lsp.extension.test.js',
'out/src/ui-test/tests/env/check.camel.version.js'
],
process.env.CODE_VERSION,
Expand Down

0 comments on commit d3810f8

Please sign in to comment.