Skip to content

Make Tintype snapshot mocks compatible with Jest 29 #24

Make Tintype snapshot mocks compatible with Jest 29

Make Tintype snapshot mocks compatible with Jest 29 #24

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-and-test:
name: build-and-test (${{ matrix.os }}, py${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
timeout-minutes: 30
env:
# Match release.yml's wheel target (CIBW_ENVIRONMENT_MACOS) so CI builds
# the same ABI as published wheels. Also raises the floor above macOS 10.15,
# which is required for std::filesystem symbols to be available — the
# Python.org 3.12+ universal2 frameworks declare a 10.13 deployment target
# in sysconfig, which propagates into extension builds and marks
# <filesystem> as unavailable. Ignored on Linux.
MACOSX_DEPLOYMENT_TARGET: "11.0"
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
cache: "pip"
- name: Install zstd (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libzstd-dev
- name: Install zstd (macOS)
if: runner.os == 'macOS'
run: brew install zstd
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Install tintype
run: pip install -v .
- name: Verify installed VS Code integration
run: |
cd "$RUNNER_TEMP"
python -c "import tintype.dap.cli, tintype.vscode"
python -c "import importlib.metadata as m; assert m.entry_points(group='console_scripts', name='tintype-dap-server')"
- name: Install test dependencies
run: pip install pytest
- name: Run tests
run: pytest tests/ -v
build-vscode-extension:
name: build-vscode-extension
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install extension dependencies
working-directory: vscode
run: npm ci
- name: Build extension
working-directory: vscode
run: npm run build
- name: Test extension
working-directory: vscode
run: npm test
- name: Build VSIX
working-directory: vscode
run: npm run package
- name: Upload VSIX
uses: actions/upload-artifact@v4
with:
name: tintype-vsix
path: vscode/dist/tintype.vsix
notify:
name: notify-on-failure
needs: [build-and-test, build-vscode-extension]
# Single workflow-level notification: fires once if ANY leg of the
# build-and-test matrix failed, instead of per-leg (avoids 6x noise
# from the 2 OS x 3 Python matrix). `failure()` at job scope returns
# true when any job in `needs:` has the `failure` result.
if: ${{ failure() }}
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Notify GChat on failure
env:
GCHAT_WEBHOOK_URL: ${{ secrets.GCHAT_WEBHOOK_URL }}
REPO: ${{ github.repository }}
REF_NAME: ${{ github.ref_name }}
WORKFLOW: ${{ github.workflow }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
text=$(printf '❌ *GitHub Action Failed*\n\n*Repo:* %s\n*Branch:* %s\n*Workflow:* %s\n*Run:* %s' \
"$REPO" "$REF_NAME" "$WORKFLOW" "$RUN_URL")
curl -X POST "$GCHAT_WEBHOOK_URL" \
-H 'Content-Type: application/json' \
-d "$(jq -n --arg text "$text" '{text: $text}')"