Skip to content

Commit 9449e48

Browse files
2 parents 4a31306 + 98f5b93 commit 9449e48

File tree

5 files changed

+346
-0
lines changed

5 files changed

+346
-0
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: 'CodeQL'
13+
14+
on:
15+
push:
16+
branches: [main]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [main]
20+
schedule:
21+
- cron: '15 16 * * 2'
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: ['javascript', 'python']
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37+
# Learn more about CodeQL language support at https://git.io/codeql-language-support
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v4
42+
with:
43+
persist-credentials: false
44+
45+
# Initializes the CodeQL tools for scanning.
46+
- name: Initialize CodeQL
47+
uses: github/codeql-action/init@v3
48+
with:
49+
languages: ${{ matrix.language }}
50+
# If you wish to specify custom queries, you can do so here or in a config file.
51+
# By default, queries listed here will override any specified in a config file.
52+
# Prefix the list here with "+" to use these queries and those in the config file.
53+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
54+
55+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
56+
# If this step fails, then you should remove it and run the build manually (see below)
57+
- name: Autobuild
58+
uses: github/codeql-action/autobuild@v3
59+
60+
# ℹ️ Command-line programs to run using the OS shell.
61+
# 📚 https://git.io/JvXDl
62+
63+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
64+
# and modify them (or add more) to build your code if your project
65+
# uses a compiled language
66+
67+
#- run: |
68+
# make bootstrap
69+
# make release
70+
71+
- name: Perform CodeQL Analysis
72+
uses: github/codeql-action/analyze@v3

.github/workflows/pr-check.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: PR Validation
2+
3+
on:
4+
pull_request:
5+
6+
permissions: {}
7+
8+
env:
9+
NODE_VERSION: 18.17.1
10+
TEST_RESULTS_DIRECTORY: .
11+
# Force a path with spaces and unicode chars to test extension works in these scenarios
12+
special-working-directory: './🐍 🐛'
13+
special-working-directory-relative: '🐍 🐛'
14+
15+
jobs:
16+
build-vsix:
17+
name: Create VSIX
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
with:
23+
persist-credentials: false
24+
25+
- name: Build VSIX
26+
uses: ./.github/actions/build-vsix
27+
with:
28+
node_version: ${{ env.NODE_VERSION }}
29+
30+
lint:
31+
name: Lint
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
with:
37+
persist-credentials: false
38+
39+
- name: Lint
40+
uses: ./.github/actions/lint
41+
with:
42+
node_version: ${{ env.NODE_VERSION }}
43+
44+
tests:
45+
name: Tests
46+
runs-on: ${{ matrix.os }}
47+
defaults:
48+
run:
49+
working-directory: ${{ env.special-working-directory }}
50+
strategy:
51+
fail-fast: false
52+
matrix:
53+
os: [ubuntu-latest, windows-latest]
54+
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
55+
56+
steps:
57+
- name: Checkout
58+
uses: actions/checkout@v4
59+
with:
60+
path: ${{ env.special-working-directory-relative }}
61+
persist-credentials: false
62+
63+
# Install bundled libs using 3.9 even though you test it on other versions.
64+
- name: Use Python 3.9
65+
uses: actions/setup-python@v5
66+
with:
67+
python-version: '3.9'
68+
69+
- name: Update pip, install pipx and install wheel
70+
run: python -m pip install -U pip pipx wheel
71+
shell: bash
72+
73+
# This will install libraries to a target directory.
74+
- name: Install bundled python libraries
75+
run: pipx run nox --session install_bundled_libs
76+
shell: bash
77+
78+
- name: Install Node
79+
uses: actions/setup-node@v4
80+
with:
81+
node-version: ${{ env.NODE_VERSION }}
82+
cache: 'npm'
83+
cache-dependency-path: ${{ env.special-working-directory-relative }}/package-lock.json
84+
85+
- name: Install dependencies (npm ci)
86+
run: npm ci
87+
88+
# Now that the bundle is installed to target using python 3.9
89+
# switch back the python we want to test with
90+
- name: Use Python ${{ matrix.python }}
91+
uses: actions/setup-python@v5
92+
with:
93+
python-version: ${{ matrix.python }}
94+
95+
# The new python may not have nox so install it again
96+
- name: Update pip, install pipx and install wheel (again)
97+
run: python -m pip install -U pip pipx wheel
98+
shell: bash
99+
100+
- name: Start xvfb on Linux
101+
run: |
102+
/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
103+
echo "DISPLAY=:99" >> $GITHUB_ENV
104+
echo ">>> Started xvfb"
105+
if: ${{ runner.os }} == 'Linux'
106+
107+
- name: Run tests
108+
run: pipx run nox --session tests
109+
shell: bash
110+
env:
111+
DISPLAY: ${{ env.DISPLAY }}

.github/workflows/pr-labels.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: 'PR labels'
2+
on:
3+
pull_request:
4+
types:
5+
- 'opened'
6+
- 'reopened'
7+
- 'labeled'
8+
- 'unlabeled'
9+
- 'synchronize'
10+
11+
jobs:
12+
add-pr-label:
13+
name: 'Ensure Required Labels'
14+
runs-on: ubuntu-latest
15+
permissions:
16+
issues: write
17+
pull-requests: write
18+
steps:
19+
- name: 'PR impact specified'
20+
uses: mheap/github-action-required-labels@388fd6af37b34cdfe5a23b37060e763217e58b03 # v5.5.0
21+
with:
22+
mode: exactly
23+
count: 1
24+
labels: 'bug, debt, feature-request, no-changelog'

.github/workflows/push-check.yml

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
name: Push Validation
2+
3+
on:
4+
push:
5+
branches:
6+
- 'main'
7+
- 'release'
8+
- 'release/*'
9+
- 'release-*'
10+
11+
permissions: {}
12+
13+
env:
14+
NODE_VERSION: 18.17.1
15+
TEST_RESULTS_DIRECTORY: .
16+
# Force a path with spaces and unicode chars to test extension works in these scenarios
17+
special-working-directory: './🐍 🐛'
18+
special-working-directory-relative: '🐍 🐛'
19+
20+
jobs:
21+
build-vsix:
22+
name: Create VSIX
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v4
27+
with:
28+
persist-credentials: false
29+
30+
- name: Build VSIX
31+
uses: ./.github/actions/build-vsix
32+
with:
33+
node_version: ${{ env.NODE_VERSION }}
34+
35+
lint:
36+
name: Lint
37+
runs-on: ubuntu-latest
38+
steps:
39+
- name: Checkout
40+
uses: actions/checkout@v4
41+
with:
42+
persist-credentials: false
43+
44+
- name: Lint
45+
uses: ./.github/actions/lint
46+
with:
47+
node_version: ${{ env.NODE_VERSION }}
48+
49+
tests:
50+
name: Tests
51+
runs-on: ${{ matrix.os }}
52+
defaults:
53+
run:
54+
working-directory: ${{ env.special-working-directory }}
55+
strategy:
56+
fail-fast: false
57+
matrix:
58+
os: [ubuntu-latest, windows-latest]
59+
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
60+
61+
steps:
62+
- name: Checkout
63+
uses: actions/checkout@v4
64+
with:
65+
path: ${{ env.special-working-directory-relative }}
66+
persist-credentials: false
67+
68+
# Install bundled libs using 3.9 even though you test it on other versions.
69+
- name: Use Python 3.9
70+
uses: actions/setup-python@v5
71+
with:
72+
python-version: '3.9'
73+
74+
- name: Update pip, install pipx and install wheel
75+
run: python -m pip install -U pip pipx wheel
76+
shell: bash
77+
78+
# This will install libraries to a target directory.
79+
- name: Install bundled python libraries
80+
run: pipx run nox --session install_bundled_libs
81+
shell: bash
82+
83+
- name: Install Node
84+
uses: actions/setup-node@v4
85+
with:
86+
node-version: ${{ env.NODE_VERSION }}
87+
cache: 'npm'
88+
cache-dependency-path: ${{ env.special-working-directory-relative }}/package-lock.json
89+
90+
- name: Install dependencies (npm ci)
91+
run: npm ci
92+
93+
# Now that the bundle is installed to target using python 3.9
94+
# switch back the python we want to test with
95+
- name: Use Python ${{ matrix.python }}
96+
uses: actions/setup-python@v5
97+
with:
98+
python-version: ${{ matrix.python }}
99+
100+
# The new python may not have nox so install it again
101+
- name: Update pip, install pipx and install wheel (again)
102+
run: python -m pip install -U pip pipx wheel
103+
shell: bash
104+
105+
- name: Start xvfb on Linux
106+
run: |
107+
/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
108+
echo "DISPLAY=:99" >> $GITHUB_ENV
109+
echo ">>> Started xvfb"
110+
if: ${{ runner.os }} == 'Linux'
111+
112+
- name: Run tests
113+
run: pipx run nox --session tests
114+
shell: bash

.vscode/settings.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Place your settings in this file to overwrite default and user settings.
2+
{
3+
"files.exclude": {
4+
"out": false, // set this to true to hide the "out" folder with the compiled JS files
5+
"dist": false // set this to true to hide the "dist" folder with the compiled JS files
6+
},
7+
"search.exclude": {
8+
"out": true, // set this to false to include "out" folder in search results
9+
"dist": true, // set this to false to include "dist" folder in search results
10+
".venv": true,
11+
".nox": true
12+
},
13+
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
14+
"typescript.tsc.autoDetect": "off",
15+
"[typescript]": {
16+
"editor.defaultFormatter": "esbenp.prettier-vscode",
17+
"editor.formatOnSave": true
18+
},
19+
"[python]": {
20+
"editor.defaultFormatter": "charliermarsh.ruff",
21+
"editor.formatOnSave": true
22+
},
23+
"git.branchProtection": ["main"],
24+
"git.branchRandomName.enable": true,
25+
}

0 commit comments

Comments
 (0)