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 7, 2024
1 parent 96c9067 commit fca940d
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 3 deletions.
52 changes: 51 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 @@ -24,6 +24,9 @@ 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 }}"

runs-on: ${{ matrix.os }}
steps:
Expand All @@ -32,6 +35,47 @@ jobs:
with:
fetch-depth: 0

- name: Check for branch in vscode-uitests-tooling (macos, ubuntu)
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-13'
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 "BRANCH_EXISTS=false" >> $GITHUB_ENV
fi
BRANCH_EXISTS=$(echo "$RESPONSE" | jq -r '.[] | select(.name=="'"$BRANCH"'") | .name')
if [ "$BRANCH_EXISTS" == "$BRANCH" ]; then
echo "BRANCH_EXISTS=true" >> $GITHUB_ENV
else
echo "BRANCH_EXISTS=false" >> $GITHUB_ENV
fi
- name: Check for branch in vscode-uitests-tooling (windows)
if: matrix.os == 'windows-latest'
run: |
$env:REPO_URL="https://api.github.com/repos/$env:USER/vscode-uitests-tooling/branches"
$env:RESPONSE=(curl -s -H "Authorization: Bearer $env:TOKEN" "$env:REPO_URL")
if ($LASTEXITCODE -ne 0) {
echo "BRANCH_EXISTS=false" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
}
$env:BRANCH_EXISTS= ($env:RESPONSE | ConvertFrom-Json | Where-Object { $_.name -eq $env:BRANCH }).name
if ($branchExists -eq $branch) {
echo "BRANCH_EXISTS=true" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
} else {
echo "BRANCH_EXISTS=false" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
}
- 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
with:
Expand Down Expand Up @@ -80,6 +124,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 fca940d

Please sign in to comment.