-
Notifications
You must be signed in to change notification settings - Fork 30
110 lines (98 loc) · 3.36 KB
/
_test_spot_private.yaml
File metadata and controls
110 lines (98 loc) · 3.36 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
104
105
106
107
108
109
110
# -*- mode: yaml; coding: utf-8 -*-
# Copyright (C) 2023 Benjamin Thomas Schwertfeger
# All rights reserved.
# https://github.com/btschwertfeger
#
# Template workflow to test the private Spot endpoints of the
# python-kraken-sdk.
#
# Runs tests for:
# * Spot REST clients
# * Spot websocket clients
#
name: Test Spot
on:
workflow_call:
inputs:
os:
type: string
required: true
python-version:
type: string
required: true
secrets:
SPOT_API_KEY:
required: true
SPOT_SECRET_KEY:
required: true
XSTOCKS_API_KEY:
required: true
XSTOCKS_SECRET_KEY:
required: true
permissions:
contents: read
jobs:
Test-Spot:
name: Test ${{ inputs.os }} ${{ inputs.python-version }}
runs-on: ${{ inputs.os }}
timeout-minutes: 10
concurrency:
group: test_spot_private
cancel-in-progress: true
steps:
- name: Harden Runner
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
with:
disable-sudo: true
egress-policy: block
allowed-endpoints: >
api.github.com:443
api.kraken.com:443
files.pythonhosted.org:443
github.com:443
objects.githubusercontent.com:443
pypi.org:443
raw.githubusercontent.com:443
release-assets.githubusercontent.com:443
ws-auth.kraken.com:443
ws.kraken.com:443
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Download the built wheel
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: python-package-distributions
path: dist/
- name: Set up Python ${{ inputs.python-version }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ inputs.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v7
- name: Install package (Linux or macOS)
if: runner.os != 'Windows'
run: |
uv venv
source .venv/bin/activate
echo ${GITHUB_WORKSPACE}/.venv/bin >> $GITHUB_PATH
uv pip install "$(find dist -name '*.whl' | head -1)" -r requirements-dev.txt
- name: Install package (Windows)
if: runner.os == 'Windows'
run: |
uv venv
.venv\Scripts\activate.ps1
echo "$env:GITHUB_WORKSPACE\.venv\Scripts" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
$wheel = (Get-ChildItem -Path dist -Filter "*.whl" | Select-Object -First 1).FullName
uv pip install $wheel -r requirements-dev.txt
- name: Testing Spot REST endpoints
env:
SPOT_API_KEY: ${{ secrets.SPOT_API_KEY }}
SPOT_SECRET_KEY: ${{ secrets.SPOT_SECRET_KEY }}
XSTOCKS_API_KEY: ${{ secrets.XSTOCKS_API_KEY }}
XSTOCKS_SECRET_KEY: ${{ secrets.XSTOCKS_SECRET_KEY }}
run: pytest -vv -x -m "spot and spot_auth and not spot_websocket" tests
- name: Testing Spot websocket client
env:
SPOT_API_KEY: ${{ secrets.SPOT_API_KEY }}
SPOT_SECRET_KEY: ${{ secrets.SPOT_SECRET_KEY }}
run: pytest -vv -x -m "spot and spot_auth and spot_websocket" tests