feat: loggedIn
context key
#420
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: tests | |
on: | |
workflow_dispatch: | |
pull_request: | |
paths-ignore: | |
- "**.md" | |
push: | |
branches: | |
- master | |
paths-ignore: | |
- "**.md" | |
permissions: | |
id-token: write | |
contents: read | |
jobs: | |
vsce-test: | |
strategy: | |
matrix: | |
os: [macos-latest, ubuntu-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install Semgrep | |
run: python -m pip install semgrep | |
- name: Setup | |
uses: actions/[email protected] | |
with: | |
node-version: lts/* | |
- name: install dependencies | |
run: npm ci | |
- uses: "aws-actions/[email protected]" | |
with: | |
role-to-assume: "arn:aws:iam::338683922796:role/semgrep-ide-integration-deploy-role" | |
role-duration-seconds: 900, | |
role-session-name: "semgrep-ide-integration-deploy" | |
aws-region: "us-west-2" | |
- if: matrix.os == 'macos-latest' | |
name: download osemgrep pro | |
run: ./download-osemgrep-pro.sh darwin-arm64 | |
- if: matrix.os == 'ubuntu-latest' | |
name: download osemgrep pro | |
run: ./download-osemgrep-pro.sh linux-x64 | |
- name: pretest | |
run: npm run pretest | |
- name: run native tests (Linux) | |
if: matrix.os == 'ubuntu-latest' | |
run: xvfb-run -a npm run test-native | |
- name: run native tests (MacOS) | |
if: matrix.os == 'macos-latest' | |
run: npm run test-native | |
- name: uninstall semgrep | |
run: python -m pip uninstall -y semgrep && rm dist/osemgrep-pro | |
- name: run js tests (Linux) | |
if: matrix.os == 'ubuntu-latest' | |
run: xvfb-run -a npm run test-js | |
- name: run js tests (MacOS) | |
if: matrix.os == 'macos-latest' | |
run: npm run test-js | |
- name: upload semgrep results for windows | |
if: matrix.os == 'ubuntu-latest' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: semgrep-results | |
path: ./*_results.json | |
vsce-test-windows: | |
needs: vsce-test | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup | |
uses: actions/[email protected] | |
with: | |
node-version: lts/* | |
- name: install dependencies | |
run: npm ci | |
# This is needed so download-lspjs.sh can run | |
- name: configure npm | |
run: npm config set script-shell "C:\\Program Files\\Git\\Bin\\bash.exe" | |
# windows doesn't like long paths :( | |
- name: Support longpaths | |
run: git config --system core.longpaths true | |
- name: pretest | |
run: npm run pretest | |
- name: download semgrep results from linux | |
uses: actions/download-artifact@v3 | |
with: | |
name: semgrep-results | |
path: ./ | |
- name: run js tests (Windows) | |
run: npm run test-js | |
vsce-prepublish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/[email protected] | |
with: | |
node-version: lts/* | |
- uses: "aws-actions/[email protected]" | |
with: | |
role-to-assume: "arn:aws:iam::338683922796:role/semgrep-ide-integration-deploy-role" | |
role-duration-seconds: 900, | |
role-session-name: "semgrep-ide-integration-deploy" | |
aws-region: "us-west-2" | |
- name: download osemgrep pro | |
run: ./download-osemgrep-pro.sh linux-x64 | |
- run: npm ci | |
- run: npm run vscode:prepublish |