2022-01-03 13:43:52 +00:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
|
2023-06-21 00:00:11 +00:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2022-01-03 13:43:52 +00:00
|
|
|
jobs:
|
|
|
|
Lint:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-06-21 00:00:11 +00:00
|
|
|
- name: Harden Runner
|
2023-08-14 23:27:56 +00:00
|
|
|
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09
|
2023-06-21 00:00:11 +00:00
|
|
|
with:
|
|
|
|
disable-sudo: true
|
|
|
|
egress-policy: block
|
|
|
|
allowed-endpoints: >
|
|
|
|
github.com:443
|
|
|
|
static.rust-lang.org:443
|
|
|
|
|
|
|
|
- name: Checkout
|
|
|
|
uses: actions/checkout@61b9e3751b92087fd0b06925ba6dd6314e06f089
|
|
|
|
|
|
|
|
- name: Rust toolchain
|
|
|
|
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
|
2022-01-03 13:43:52 +00:00
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
components: rustfmt
|
2023-06-21 00:00:11 +00:00
|
|
|
|
2022-01-03 13:43:52 +00:00
|
|
|
- name: Check Formatting
|
2023-02-14 13:20:59 +00:00
|
|
|
run: cargo fmt --check
|
2022-01-03 13:43:52 +00:00
|
|
|
|
|
|
|
Test:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
|
|
python-version: [3.9]
|
|
|
|
include:
|
2023-01-13 16:29:38 +00:00
|
|
|
- os: ubuntu-latest
|
|
|
|
python-version: "3.11"
|
2022-01-03 13:43:52 +00:00
|
|
|
- os: ubuntu-latest
|
|
|
|
python-version: "3.10"
|
|
|
|
- os: ubuntu-latest
|
|
|
|
python-version: 3.8
|
|
|
|
- os: ubuntu-latest
|
|
|
|
python-version: 3.7
|
|
|
|
runs-on: "${{ matrix.os }}"
|
|
|
|
steps:
|
2023-06-21 00:00:11 +00:00
|
|
|
- name: Harden Runner
|
2023-08-14 23:27:56 +00:00
|
|
|
uses: step-security/harden-runner@8ca2b8b2ece13480cda6dacd3511b49857a23c09
|
2023-06-21 00:00:11 +00:00
|
|
|
with:
|
|
|
|
disable-sudo: true
|
|
|
|
egress-policy: block
|
|
|
|
allowed-endpoints: >
|
|
|
|
api.github.com:443
|
|
|
|
crates.io:443
|
|
|
|
files.pythonhosted.org:443
|
|
|
|
github.com:443
|
|
|
|
pypi.org:443
|
|
|
|
static.crates.io:443
|
|
|
|
index.crates.io:443
|
|
|
|
static.rust-lang.org:443
|
|
|
|
|
|
|
|
- uses: actions/checkout@61b9e3751b92087fd0b06925ba6dd6314e06f089
|
2023-10-03 07:53:22 +00:00
|
|
|
- uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # 4.7.1
|
2022-01-03 13:43:52 +00:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
2023-06-21 00:00:11 +00:00
|
|
|
|
|
|
|
- uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af
|
2022-01-03 13:43:52 +00:00
|
|
|
with:
|
|
|
|
toolchain: stable
|
2023-06-21 00:00:11 +00:00
|
|
|
|
2023-09-18 22:23:15 +00:00
|
|
|
- uses: Swatinem/rust-cache@a95ba195448af2da9b00fb742d14ffaaf3c21f43 # 2.7.0
|
2022-01-17 12:57:34 +00:00
|
|
|
- run: python3 -m pip install nox
|
|
|
|
- run: nox -s test-${{ matrix.python-version }}
|