-
Notifications
You must be signed in to change notification settings - Fork 205
139 lines (105 loc) · 3.35 KB
/
build_and_test.yml
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: PyTest
on:
push:
branches:
- "**"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
PYTHON_VERSION: "3.10"
COUNTERPARTY_RS_DIR: "./counterparty-rs"
jobs:
macos-m1:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
# Install dependencies
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Install Python 3.10 and leveldb
run: |
brew install rustup [email protected] leveldb
brew reinstall rustup
echo '/opt/homebrew/opt/[email protected]/libexec/bin' >> $GITHUB_PATH
- name: Install pytest and build module
run: |
python3.10 -m pip install pytest hatchling==1.25.0 hatch==1.13.0
python3.10 -m pip install --upgrade build
# Build counterparty packages
- name: Test counterparty-rs
run: |
cd ${{ env.COUNTERPARTY_RS_DIR }}
cargo test
- name: Build counterparty-rs
uses: messense/maturin-action@v1
with:
args: --release --out dist --sdist -m ${{ env.COUNTERPARTY_RS_DIR }}/Cargo.toml
- name: Build counterparty-core
run: |
cd counterparty-core && hatch build ../dist
# Install counterparty packages
- name: Install wheels
run: |
export LIBRARY_PATH="$LIBRARY_PATH:$(brew --prefix)/lib"
export CPATH="$CPATH:$(brew --prefix)/include"
python3.10 -m pip install dist/*.whl --force-reinstall
# Run counterparty-core tests
- name: Run counterparty-core tests
run: |
cd counterparty-core
hatch run pytest
# Upload wheels
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: macos-m1-wheels
path: dist
ubuntu-22-04:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
# Install dependencies
- uses: actions/setup-python@v4
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "pip"
- name: Install Rust
run: |
curl https://sh.rustup.rs -sSf | sh -s -- -y
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
- name: Install leveldb
run: |
sudo apt-get install -y libleveldb-dev
- name: Install pytest and build module
run: |
pip install pytest hatchling==1.25.0 hatch==1.13.0
python -m pip install --upgrade build
# Build counterparty packages
- name: Test counterparty-rs
run: |
cd ${{ env.COUNTERPARTY_RS_DIR }}
cargo test
- name: Build counterparty-rs
uses: messense/maturin-action@v1
with:
args: --release --out dist --sdist -m ${{ env.COUNTERPARTY_RS_DIR }}/Cargo.toml
- name: Build counterparty-core
run: |
cd counterparty-core && hatch build ../dist
# Install counterparty packages
- name: Install wheels
run: |
pip install dist/*.whl --force-reinstall
# Run counterparty-core tests
- name: Run counterparty-core tests
run: |
cd counterparty-core
pytest
# Upload wheels
- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: ubuntu-22-04-wheels
path: dist