Repository navigation
54 lines (50 loc) · 1.9 KB
/
Copy pathci.yml
File metadata and controls
54 lines (50 loc) · 1.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
---
name: ci
"on":
pull_request:
push:
branches: [main]
permissions:
contents: read
jobs:
test:
name: Python ${{ matrix.python }}, Libcloud ${{ matrix.libcloud }}
# Pushes to main run on the org runner; pull requests and everything else stay GitHub-hosted.
runs-on: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && fromJSON('["self-hosted","linux","x64"]') || 'ubuntu-latest' }}
strategy:
fail-fast: false
matrix:
python: ["3.10", "3.11", "3.12", "3.13"]
libcloud: ["3.8.0", "3.9.1"]
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python }}
- run: pip install -e ".[test]" "apache-libcloud==${{ matrix.libcloud }}" ruff build
- name: Ruff
run: ruff check . && ruff format --check .
- name: Unit tests
run: pytest tests --ignore=tests/test_live.py
- name: Build
run: python -m build
# Calls the real NodeRings API (free objects only). Runs when the NODERINGS_TOKEN
# secret is set, on pushes and on pull requests from this repository.
live:
needs: test
# Pushes to main run on the org runner; pull requests and everything else stay GitHub-hosted.
runs-on: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && fromJSON('["self-hosted","linux","x64"]') || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
env:
NODERINGS_TOKEN: ${{ secrets.NODERINGS_TOKEN }}
steps:
- uses: actions/checkout@v7
if: env.NODERINGS_TOKEN != ''
- uses: actions/setup-python@v7
if: env.NODERINGS_TOKEN != ''
with:
python-version: "3.12"
- if: env.NODERINGS_TOKEN != ''
run: pip install -e ".[test]" && pytest tests/test_live.py -v