Skip to content
Closed
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
62 changes: 44 additions & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,28 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/setup-node@v3
with:
node-version: '18'

- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1

- uses: actions/setup-node@v1
with:
node-version: '16.13.0'

- name: Install dependencies
working-directory: extensions/ql-vscode
run: |
npm install
env:
NODE_OPTIONS: --openssl-legacy-provider
shell: bash

- name: Build
working-directory: extensions/ql-vscode
env:
APP_INSIGHTS_KEY: '${{ secrets.APP_INSIGHTS_KEY }}'
NODE_OPTIONS: --openssl-legacy-provider
run: |
npm run build
shell: bash
Expand Down Expand Up @@ -75,60 +78,73 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/setup-node@v3
with:
node-version: '18'

- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 1

- uses: actions/setup-node@v1
with:
node-version: '16.13.0'

- name: Install dependencies
shell: bash
working-directory: extensions/ql-vscode
env:
NODE_OPTIONS: --openssl-legacy-provider
run: |
npm install
shell: bash

- name: Build
working-directory: extensions/ql-vscode
shell: bash
env:
NODE_OPTIONS: --openssl-legacy-provider
APP_INSIGHTS_KEY: '${{ secrets.APP_INSIGHTS_KEY }}'
run: |
npm run build
shell: bash

- name: Lint
shell: bash
working-directory: extensions/ql-vscode
env:
NODE_OPTIONS: --openssl-legacy-provider
run: |
npm run lint

- name: Run unit tests (Linux)
working-directory: extensions/ql-vscode
shell: bash
if: matrix.os == 'ubuntu-latest'
env:
NODE_OPTIONS: --openssl-legacy-provider
run: |
npm run test

- name: Run unit tests (Windows)
if: matrix.os == 'windows-latest'
shell: bash
env:
NODE_OPTIONS: --openssl-legacy-provider
working-directory: extensions/ql-vscode
run: |
npm run test

- name: Run integration tests (Linux)
if: matrix.os == 'ubuntu-latest'
shell: bash
working-directory: extensions/ql-vscode
env:
NODE_OPTIONS: --openssl-legacy-provider
VSCODE_CODEQL_GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
run: |
sudo apt-get install xvfb
/usr/bin/xvfb-run npm run integration

- name: Run integration tests (Windows)
if: matrix.os == 'windows-latest'
shell: bash
working-directory: extensions/ql-vscode
env:
VSCODE_CODEQL_GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
run: |
npm run integration

Expand All @@ -146,24 +162,28 @@ jobs:
TEST_CODEQL_PATH: '${{ github.workspace }}/codeql'

steps:
- uses: actions/setup-node@v3
with:
node-version: '18'

- name: Checkout
uses: actions/checkout@v2

- uses: actions/setup-node@v1
with:
node-version: '16.13.0'

- name: Install dependencies
working-directory: extensions/ql-vscode
shell: bash
env:
NODE_OPTIONS: --openssl-legacy-provider
run: |
npm install
shell: bash

- name: Build
working-directory: extensions/ql-vscode
shell: bash
env:
NODE_OPTIONS: --openssl-legacy-provider
run: |
npm run build
shell: bash

- name: Decide on ref of CodeQL repo
id: choose-ref
Expand All @@ -190,11 +210,17 @@ jobs:
- name: Run CLI tests (Linux)
working-directory: extensions/ql-vscode
if: matrix.os == 'ubuntu-latest'
shell: bash
env:
NODE_OPTIONS: --openssl-legacy-provider
run: |
/usr/bin/xvfb-run npm run cli-integration

- name: Run CLI tests (Windows)
working-directory: extensions/ql-vscode
if: matrix.os == 'windows-latest'
shell: bash
env:
NODE_OPTIONS: --openssl-legacy-provider
run: |
npm run cli-integration
23 changes: 13 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,32 @@ jobs:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v3
with:
node-version: '18'

- name: Checkout
uses: actions/checkout@v2

- uses: actions/setup-node@v1
with:
node-version: '16.13.0'

- name: Install dependencies
shell: bash
run: |
cd extensions/ql-vscode
npm ci
shell: bash

- name: Build
shell: bash
env:
NODE_OPTIONS: --openssl-legacy-provider
APP_INSIGHTS_KEY: '${{ secrets.APP_INSIGHTS_KEY }}'
run: |
echo "APP INSIGHTS KEY LENGTH: ${#APP_INSIGHTS_KEY}"
cd extensions/ql-vscode
npm run build -- --release
shell: bash

- name: Prepare artifacts
id: prepare-artifacts
shell: bash
run: |
mkdir artifacts
cp dist/*.vsix artifacts
Expand Down Expand Up @@ -95,12 +97,14 @@ jobs:
# The checkout action does not fetch the main branch.
# Fetch the main branch so that we can base the version bump PR against main.
- name: Fetch main branch
shell: bash
run: |
git fetch --depth=1 origin main:main
git checkout main

- name: Bump patch version
id: bump-patch-version
shell: bash
if: success()
run: |
cd extensions/ql-vscode
Expand All @@ -110,6 +114,7 @@ jobs:
echo "::set-output name=next_version::$NEXT_VERSION"

- name: Add changelog for next release
shell: bash
if: success()
run: |
cd extensions/ql-vscode
Expand All @@ -132,15 +137,14 @@ jobs:
needs: build
environment: publish-vscode-marketplace
runs-on: ubuntu-latest
env:
VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }}
steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: vscode-codeql-extension

- name: Publish to Registry
shell: bash
run: |
npx vsce publish -p $VSCE_TOKEN --packagePath *.vsix || \
echo "Failed to publish to VS Code Marketplace. \
Expand All @@ -152,14 +156,13 @@ jobs:
needs: build
environment: publish-open-vsx
runs-on: ubuntu-latest
env:
OPEN_VSX_TOKEN: ${{ secrets.OPEN_VSX_TOKEN }}
steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: vscode-codeql-extension

- name: Publish to Registry
shell: bash
run: |
npx ovsx publish -p $OPEN_VSX_TOKEN *.vsix
Loading