Skip to content

Commit 0b939de

Browse files
committed
👷 ci: refactor CI setup
1 parent 8140eaa commit 0b939de

File tree

10 files changed

+90
-53
lines changed

10 files changed

+90
-53
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Setup code checks
2+
description: "Setup toolchain and run smoke test"
3+
runs:
4+
using: composite
5+
steps:
6+
- name: ⬇️ Import Outscale API description
7+
run: make init
8+
shell: bash
9+
- name: ⬇️ Install uv
10+
uses: astral-sh/setup-uv@v6
11+
- name: ⬇️ Setup Python
12+
run: uv python install
13+
shell: bash
14+
- name: ⬇️ Build python package
15+
run: make package
16+
shell: bash
17+

.github/workflows/code-check-identified.yml

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ on:
66
- main
77

88
permissions:
9-
pull-requests: write
10-
contents: write
9+
contents: read
1110

1211
jobs:
1312
code-check:
14-
runs-on: [self-hosted, linux, eu-west-2]
13+
runs-on: ubuntu-24.04
14+
environment: eu-west-2
1515
steps:
1616
- name: 🧹 Frieza
1717
uses: outscale/frieza-github-actions/frieza-clean@master
@@ -21,33 +21,12 @@ jobs:
2121
region: ${{ secrets.OSC_REGION }}
2222
- name: ⬇️ Checkout repository
2323
uses: actions/checkout@v5
24-
- name: ⬇️ Import Outscale API description
25-
run: make init
26-
- name: Install uv
27-
uses: astral-sh/setup-uv@v6
28-
- name: Set up Python
29-
run: uv python install
30-
- name: ⬇️ Build python package
31-
run: make package
24+
- name: Setup toolchain
25+
uses: ./.github/actions/setup-test
3226
- name: 🧪 Run integration tests
3327
env:
3428
OSC_ACCESS_KEY: ${{ secrets.OSC_ACCESS_KEY }}
3529
OSC_SECRET_KEY: ${{ secrets.OSC_SECRET_KEY }}
3630
OSC_TEST_LOGIN: ${{ secrets.OSC_TEST_LOGIN }}
3731
OSC_TEST_PASSWORD: ${{ secrets.OSC_TEST_PASSWORD }}
3832
run: make test-int
39-
dependabot-auto-merge:
40-
needs: [code-check]
41-
runs-on: ubuntu-latest
42-
if: ${{ github.actor == 'dependabot[bot]' }}
43-
steps:
44-
- name: Dependabot metadata
45-
id: metadata
46-
uses: dependabot/[email protected]
47-
with:
48-
github-token: "${{ secrets.GITHUB_TOKEN }}"
49-
- name: Auto-merge
50-
run: gh pr merge --auto --rebase "$PR_URL"
51-
env:
52-
PR_URL: ${{github.event.pull_request.html_url}}
53-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/code-check.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,18 @@ name: Code check Local
33
on:
44
pull_request:
55
branches:
6-
- main
6+
- main
7+
8+
permissions:
9+
contents: read
710

811
jobs:
912
code-check:
1013
runs-on: ubuntu-24.04
1114
steps:
12-
- uses: actions/checkout@v5
13-
- name: Import Outscale API description
14-
run: make init
15-
- name: Install uv
16-
uses: astral-sh/setup-uv@v6
17-
- name: Set up Python
18-
run: uv python install
19-
- name: Analysing the code
20-
run: make test-lint
15+
- name: ⬇️ Checkout repository
16+
uses: actions/checkout@v5
17+
- name: Setup toolchain
18+
uses: ./.github/actions/setup-test
2119
- name: Run integration tests
2220
run: ./local-tests.sh

.github/workflows/publish.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,8 @@ jobs:
1313
runs-on: ubuntu-24.04
1414
environment: publish
1515
steps:
16-
- uses: actions/checkout@v5
17-
- name: Install uv
18-
uses: astral-sh/setup-uv@v6
19-
- name: Set up Python
20-
run: uv python install
21-
- name: Check Code
22-
run: make test
16+
- name: Setup toolchain
17+
uses: ./.github/actions/setup-test
2318
- name: Build & Push packages
2419
run: make upload-package
2520
env:

local-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export OSC_TEST_LOGIN=joe
33
export OSC_SECRET_KEY=0000001111112222223333334444445555555666
44
export OSC_ACCESS_KEY=11112211111110000000
55
export OSC_ENDPOINT_API=http://127.0.0.1:3000
6-
6+
export OSC_IS_RICOCHET=true
77

88
if [ "$#" -eq 0 ]; then
99

pyproject.toml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "osc_sdk_python"
3-
version = "0.37.0"
3+
version = "0.38.0"
44
description = "Outscale Gateway python SDK"
55
authors = [
66
{ name = "Outscal SAS", email = "[email protected]" }
@@ -10,19 +10,26 @@ requires-python = ">=3.9"
1010
license = { text = "BSD" }
1111
keywords = []
1212
classifiers = [
13-
"Programming Language :: Python :: 3",
13+
"Programming Language :: Python :: 3.9",
14+
"Programming Language :: Python :: 3.10",
15+
"Programming Language :: Python :: 3.11",
16+
"Programming Language :: Python :: 3.12",
17+
"Programming Language :: Python :: 3.13",
18+
"Programming Language :: Python :: 3.14",
1419
"License :: OSI Approved :: BSD License",
1520
"Operating System :: OS Independent"
1621
]
1722
dependencies = [
18-
"requests>=2.32.5",
19-
"ruamel.yaml==0.18.16"
23+
"requests>=2.20.0",
24+
"ruamel.yaml==0.18.16",
25+
"urllib3>=2.0.0",
2026
]
2127

2228
[dependency-groups]
2329
dev = [
2430
"pytest>=7.2.0",
2531
"tox-uv>=1.11.3",
32+
"ruff>=0.14.7",
2633
]
2734

2835
[project.urls]

shell.nix

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
let
2-
nixpkgs = builtins.fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-25.05";
2+
nixpkgs = builtins.fetchTarball "https://github.com/NixOS/nixpkgs/tarball/nixos-25.11";
33
pkgs = import nixpkgs {
44
config = {};
55
overlays = [];
@@ -8,5 +8,6 @@ in
88
pkgs.mkShellNoCC {
99
packages = with pkgs; [
1010
uv
11+
python313Packages.tox
1112
];
1213
}

tests/test_net.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import unittest
22
import sys
3+
import os
34
import requests
45
sys.path.append("..")
56
from osc_sdk_python import Gateway
67

78
class TestNet(unittest.TestCase):
9+
@unittest.skipIf(os.environ.get("OSC_IS_RICOCHET") is not None, "This test is failing under ricochet")
810
def test_creation_error(self):
911
gw = Gateway()
1012
with self.assertRaises(requests.exceptions.HTTPError) as cm:

tox.ini

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@
22
skipsdist = true
33
envlist = py39, py310, py311, py312, py313, py314
44

5+
[gh-actions]
6+
python =
7+
3.9: py39
8+
3.10: py310
9+
3.11: py311
10+
3.12: py312
11+
3.14: py314
12+
513
[testenv]
6-
passenv = PYTHON_VERSION, OSC_ACCESS_KEY, OSC_SECRET_KEY, OSC_REGION, OSC_TEST_LOGIN, OCS_TEST_PASSWORD
14+
passenv = PYTHON_VERSION, OSC_ACCESS_KEY, OSC_SECRET_KEY, OSC_REGION, OSC_TEST_LOGIN, OCS_TEST_PASSWORD, OSC_ENDPOINT_API, OSC_IS_RICOCHET
715
allowlist_externals = uv
816
commands =
917
uv sync --python {envpython}

uv.lock

Lines changed: 33 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)