Skip to content

Commit 46ea504

Browse files
author
igorsyl
committed
add test workflow
1 parent 317dc43 commit 46ea504

File tree

2 files changed

+259
-1
lines changed

2 files changed

+259
-1
lines changed

.github/workflows/test.yml

Lines changed: 258 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,258 @@
1+
# This file is autogenerated by maturin v1.7.4
2+
# To update, run
3+
#
4+
# maturin generate-ci github --pytest
5+
#
6+
name: Test
7+
8+
on:
9+
push:
10+
branches:
11+
- main
12+
- staging
13+
tags:
14+
- '*'
15+
pull_request:
16+
branches: [main, staging]
17+
workflow_dispatch:
18+
19+
permissions:
20+
contents: read
21+
22+
jobs:
23+
linux:
24+
runs-on: ${{ matrix.platform.runner }}
25+
strategy:
26+
matrix:
27+
platform:
28+
- runner: ubuntu-latest
29+
target: x86_64
30+
- runner: ubuntu-latest
31+
target: x86
32+
# - runner: ubuntu-latest
33+
# target: aarch64
34+
# - runner: ubuntu-latest
35+
# target: armv7
36+
# - runner: ubuntu-latest
37+
# target: s390x
38+
# - runner: ubuntu-latest
39+
# target: ppc64le
40+
steps:
41+
- uses: actions/checkout@v4
42+
- uses: actions/setup-python@v5
43+
with:
44+
python-version: 3.x
45+
- name: Build wheels
46+
uses: PyO3/maturin-action@v1.44.0
47+
with:
48+
target: ${{ matrix.platform.target }}
49+
args: --release --out dist --find-interpreter
50+
sccache: 'true'
51+
manylinux: auto
52+
before-script-linux: (apt-get update && apt-get install -y apt-utils && apt-get install -y pkg-config libssl-dev) || (yum install openssl openssl-devel -y)
53+
# - name: Upload wheels
54+
# uses: actions/upload-artifact@v4
55+
# with:
56+
# name: wheels-linux-${{ matrix.platform.target }}
57+
# path: dist
58+
- name: Install sccache
59+
uses: mozilla-actions/sccache-action@v0.0.3
60+
- name: pytest
61+
if: ${{ startsWith(matrix.platform.target, 'x86_64') }}
62+
shell: bash
63+
run: |
64+
set -e
65+
python3 -m venv .venv
66+
source .venv/bin/activate
67+
pip install bittensor-wallet[dev] --find-links dist --force-reinstall
68+
pip install pytest
69+
pytest
70+
- name: pytest
71+
if: ${{ !startsWith(matrix.platform.target, 'x86') && matrix.platform.target != 'ppc64' }}
72+
uses: uraimo/run-on-arch-action@v2
73+
with:
74+
arch: ${{ matrix.platform.target }}
75+
distro: ubuntu22.04
76+
githubToken: ${{ github.token }}
77+
install: |
78+
apt-get update
79+
apt-get install -y --no-install-recommends python3 python3-pip
80+
pip3 install -U pip pytest
81+
run: |
82+
set -e
83+
pip3 install bittensor-wallet[dev] --find-links dist --force-reinstall
84+
pytest
85+
86+
# musllinux:
87+
# runs-on: ${{ matrix.platform.runner }}
88+
# strategy:
89+
# matrix:
90+
# platform:
91+
# - runner: ubuntu-latest
92+
# target: x86_64
93+
# - runner: ubuntu-latest
94+
# target: x86
95+
# - runner: ubuntu-latest
96+
# target: aarch64
97+
# - runner: ubuntu-latest
98+
# target: armv7
99+
# steps:
100+
# - uses: actions/checkout@v4
101+
# - uses: actions/setup-python@v5
102+
# with:
103+
# python-version: 3.x
104+
# - name: Build wheels
105+
# uses: PyO3/maturin-action@v1
106+
# with:
107+
# target: ${{ matrix.platform.target }}
108+
# args: --release --out dist --find-interpreter
109+
# sccache: 'true'
110+
# manylinux: musllinux_1_2
111+
# - name: Upload wheels
112+
# uses: actions/upload-artifact@v4
113+
# with:
114+
# name: wheels-musllinux-${{ matrix.platform.target }}
115+
# path: dist
116+
# - name: pytest
117+
# if: ${{ startsWith(matrix.platform.target, 'x86_64') }}
118+
# uses: addnab/docker-run-action@v3
119+
# with:
120+
# image: alpine:latest
121+
# options: -v ${{ github.workspace }}:/io -w /io
122+
# run: |
123+
# set -e
124+
# apk add py3-pip py3-virtualenv
125+
# python3 -m virtualenv .venv
126+
# source .venv/bin/activate
127+
# pip install bittensor-wallet --no-index --find-links dist --force-reinstall
128+
# pip install pytest
129+
# pytest
130+
# - name: pytest
131+
# if: ${{ !startsWith(matrix.platform.target, 'x86') }}
132+
# uses: uraimo/run-on-arch-action@v2
133+
# with:
134+
# arch: ${{ matrix.platform.target }}
135+
# distro: alpine_latest
136+
# githubToken: ${{ github.token }}
137+
# install: |
138+
# apk add py3-virtualenv
139+
# run: |
140+
# set -e
141+
# python3 -m virtualenv .venv
142+
# source .venv/bin/activate
143+
# pip install pytest
144+
# pip install bittensor-wallet --find-links dist --force-reinstall
145+
# pytest
146+
147+
# windows:
148+
# runs-on: ${{ matrix.platform.runner }}
149+
# strategy:
150+
# matrix:
151+
# platform:
152+
# - runner: windows-latest
153+
# target: x64
154+
# - runner: windows-latest
155+
# target: x86
156+
# steps:
157+
# - uses: actions/checkout@v4
158+
# - uses: actions/setup-python@v5
159+
# with:
160+
# python-version: 3.x
161+
# architecture: ${{ matrix.platform.target }}
162+
# - name: Build wheels
163+
# uses: PyO3/maturin-action@v1
164+
# with:
165+
# target: ${{ matrix.platform.target }}
166+
# args: --release --out dist --find-interpreter
167+
# sccache: 'true'
168+
# - name: Upload wheels
169+
# uses: actions/upload-artifact@v4
170+
# with:
171+
# name: wheels-windows-${{ matrix.platform.target }}
172+
# path: dist
173+
# - name: pytest
174+
# if: ${{ !startsWith(matrix.platform.target, 'aarch64') }}
175+
# shell: bash
176+
# run: |
177+
# set -e
178+
# python3 -m venv .venv
179+
# source .venv/Scripts/activate
180+
# pip install bittensor-wallet --find-links dist --force-reinstall
181+
# pip install pytest
182+
# pytest
183+
184+
macos:
185+
runs-on: ${{ matrix.platform.runner }}
186+
strategy:
187+
matrix:
188+
platform:
189+
- runner: macos-12
190+
target: x86_64
191+
- runner: macos-14
192+
target: aarch64
193+
steps:
194+
- uses: actions/checkout@v4
195+
- uses: actions/setup-python@v5
196+
with:
197+
python-version: 3.x
198+
- name: Build wheels
199+
uses: PyO3/maturin-action@v1.44.0
200+
with:
201+
target: ${{ matrix.platform.target }}
202+
args: --release --out dist --find-interpreter
203+
sccache: 'true'
204+
# - name: Upload wheels
205+
# uses: actions/upload-artifact@v4
206+
# with:
207+
# name: wheels-macos-${{ matrix.platform.target }}
208+
# path: dist
209+
- name: pytest
210+
run: |
211+
set -e
212+
python3 -m venv .venv
213+
source .venv/bin/activate
214+
pip install bittensor-wallet[dev] --find-links dist --force-reinstall
215+
pip install pytest
216+
pytest
217+
218+
# sdist:
219+
# runs-on: ubuntu-latest
220+
# steps:
221+
# - uses: actions/checkout@v4
222+
# - name: Build sdist
223+
# uses: PyO3/maturin-action@v1
224+
# with:
225+
# command: sdist
226+
# args: --out dist
227+
# - name: Upload sdist
228+
# uses: actions/upload-artifact@v4
229+
# with:
230+
# name: wheels-sdist
231+
# path: dist
232+
233+
# release:
234+
# name: Release
235+
# runs-on: ubuntu-latest
236+
# if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
237+
# needs: [linux, musllinux, windows, macos, sdist]
238+
# permissions:
239+
# # Use to sign the release artifacts
240+
# id-token: write
241+
# # Used to upload release artifacts
242+
# contents: write
243+
# # Used to generate artifact attestation
244+
# attestations: write
245+
# steps:
246+
# - uses: actions/download-artifact@v4
247+
# - name: Generate artifact attestation
248+
# uses: actions/attest-build-provenance@v1
249+
# with:
250+
# subject-path: 'wheels-*/*'
251+
# - name: Publish to PyPI
252+
# if: "startsWith(github.ref, 'refs/tags/')"
253+
# uses: PyO3/maturin-action@v1
254+
# env:
255+
# MATURIN_PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
256+
# with:
257+
# command: upload
258+
# args: --non-interactive --skip-existing wheels-*/*

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)