Skip to content

CI

CI #1289

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
schedule:
- cron: '7 5 * * *'
defaults:
run:
shell: bash
env:
FORCE_COLOR: "1"
jobs:
lint:
runs-on: ubuntu-latest
name: "Lint"
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set Up Python 3.10
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Lint the code
run: |
python -m pip install nox
nox -s lint
test:
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
python-version: ["3.10", "3.11", "3.12", "3.13", "pypy3.10"]
runs-on: ${{ matrix.os }}
name: ${{ fromJson('{"macos-latest":"macOS","windows-latest":"Windows","ubuntu-latest":"Ubuntu"}')[matrix.os] }} Python ${{ matrix.python-version }}
continue-on-error: false
timeout-minutes: 10
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.x
- name: Install mkcert on macOS
if: runner.os == 'macOS'
run: |
go install filippo.io/[email protected]
# for non-interactive install of root CA
sudo security authorizationdb write com.apple.trust-settings.admin allow
mkcert -install
- name: Install mkcert on Linux
if: runner.os == 'Linux'
run: |
sudo apt-get update
go install filippo.io/[email protected]
sudo apt-get install libnss3-tools
mkcert -install
- name: Run tests
run: |
python -m pip install nox
nox -s test
compileall:
# Run 'python -m compileall' on an old Python version
# to ensure that pip can vendor truststore successfully.
runs-on: ubuntu-latest
name: compileall
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.7"
- run: |
python -m compileall -qq -f src/truststore/
integration-pip:
runs-on: ubuntu-latest
name: Integration pip
timeout-minutes: 10
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
path: truststore
- name: Checkout pypa/pip
uses: actions/checkout@v4
with:
repository: pypa/pip
path: pip
- name: Setup Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Patch tests to install local copy of truststore
working-directory: "${{ github.workspace }}/pip"
run: |
sed -i 's|script.pip("install", "truststore")|script.pip("install", "${{ github.workspace }}/truststore")|' tests/functional/test_truststore.py
- name: Run tests
working-directory: "${{ github.workspace }}/pip"
run: |
python -m pip install nox
nox -s test-3.11 -- \
-m integration \
tests/functional/test_truststore.py
- name: Run pip debug
working-directory: "${{ github.workspace }}/pip"
run: |
python -m pip install -e .
python -m pip debug