-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (90 loc) · 3.48 KB
/
Copy pathUVTest.yml
File metadata and controls
103 lines (90 loc) · 3.48 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: ⚡Test (UV)
on:
workflow_dispatch:
workflow_call:
inputs:
repo:
required: false
type: string
default: dev
# Retain environment input if needed by secrets step
environment:
required: false # Adjust as needed
type: string
default: '' # Or a sensible default
jobs:
test:
name: ⚡ Test (UV)
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.11.6"] # Consider making this dynamic or matching build
include:
- experimental: true # Keep if needed for Python setup
# Removed check-latest, assuming not relevant for UV specific setup
# Pass environment if needed by secrets step
environment: ${{ inputs.environment }}
steps:
- name: 📥 Checkout the repository
uses: actions/checkout@v4
- name: 🐍 Set up Python & UV
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: ${{ matrix.experimental }}
# cache: 'uv' # Cache UV dependencies - Removed, not supported yet
- name: ⬇️ Install uv
run: pip install uv
- name: 🛠️ Install dependencies
run: uv sync --all-extras # Install main and optional/dev dependencies for tests
- name: 🔒️ Install 1Password CLI
uses: 1password/install-cli-action@v1
- name: 🔒️ Get Secrets
run: |
# Ensure SETTINGS env var doesn't conflict if op read uses it differently
OP_SETTINGS_PATH=$(op read op://git/SETTINGS/${{ inputs.repo }})
echo "Reading settings from: $OP_SETTINGS_PATH"
op read $OP_SETTINGS_PATH > settings.toml
echo "TT_CONFIG_DIR=$(pwd)" >> $GITHUB_ENV # Export TT_CONFIG_DIR for subsequent steps
working-directory: . # Ensure this runs in the correct directory
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
# Keep IBC Gateway step if relevant to the projects using this workflow
- name: Install IBC Gateway
if: ${{ github.repository == 'mraniki/cefi' }} # Keep condition or adjust
run: |
wget -q https://github.com/IbcAlpha/IBC/releases/download/3.18.0-Update.1/IBCLinux-3.18.0.zip -O ibc.zip \
&& unzip ibc.zip -d /opt/ibc \
&& chmod +x /opt/ibc/*.sh /opt/ibc/*/*.sh
- name: 🧪 Test with pytest
run: uv run pytest --cov . --cov-report=xml # Use uv run
- name: 🧾 Upload coverage to Codecov
uses: codecov/codecov-action@v5 # Ensure v5 is the latest or desired version
with:
token: ${{ secrets.CODECOV_TOKEN }}
# Consider adding fail_ci_if_error: true
# Keep test-results job as is
test-results:
name: 🧪🧾 Test Results
runs-on: ubuntu-latest
needs: [test]
steps:
- name: ℹ️ Results Consolidation
run: |
echo "Test Results Completed"
# Keep automerge job as is
automerge:
name: ⛙ Enable Pull Request Automerge to dev
runs-on: ubuntu-latest
needs: [test-results]
if: ${{ github.base_ref == 'dev' }}
steps:
- name: 📥 Checkout the repository
uses: actions/checkout@v4
- name: Enable Pull Request Automerge
run: gh pr merge --auto --merge ${{ github.event.pull_request.number }}
env:
GH_TOKEN: ${{ github.token }} # Use github.token for built-in auth
shell: bash