-
Notifications
You must be signed in to change notification settings - Fork 4
170 lines (157 loc) · 4.65 KB
/
generate.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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# This is a basic workflow to help you get started with Actions
name: BUILD
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.x
uses: actions/setup-python@v5
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.x'
# Optional - x64 or x86 architecture, defaults to x64
architecture: 'x64'
# You can test your matrix by printing the current Python version
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Run generating adds and mults
run: python generate_test.py
- name: Run generating mac
run: python generate_mac.py
- name: Run generating axmults
run: python generate_axmuls.py
- name: Upload results
uses: actions/upload-artifact@v4
with:
name: arithmetic-circuits-8
path: test_circuits
test:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v4
- name: Install iverilog
run: sudo apt install iverilog
- name: Set up Python 3.x
uses: actions/setup-python@v5
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.x'
- run: python -m pip install numpy
- name: Download workflow run artifacts
uses: actions/download-artifact@v4
with:
name: arithmetic-circuits-8
path: test_circuits
- name: Listing
run: |
ls
- name: Run 8b testing
run: |
cd tests
bash test_circuits.sh
cd ..
- name: Run 8b CGP testing
run: |
cd tests
bash test_circuits_cgp.sh
cd ..
- name: Run MAC testing
run: |
cd tests
bash test_mac.sh
cd ..
- name: Verilog testing
run: |
cd tests
bash test_circuits_verilog.sh
cd ..
- name: Python circuits testing
run: |
cd tests
python test_all.py
cd ..
- name: Python ax testing
run: |
cd tests
python test_ax.py
cd ..
- name: Python CGP testing
run: |
cd tests
python test_cgp.py
cd ..
- name: Python Compare testing
run: |
cd tests
python test_compare.py
cd ..
- name: Python Popcount testing
run: |
cd tests
python test_popcnt.py
cd ..
- name: Python Reduce testing
run: |
cd tests
python test_reduce.py
cd ..
test_python:
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11' ]
name: Python ${{ matrix.python-version }} test
steps:
- uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: x64
- run: python -m pip install numpy pytest
- name: Run pytest
run: |
pytest
# Only on main thread
documentation:
runs-on: ubuntu-latest
needs: test
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.x
uses: actions/setup-python@v5
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.x'
# Optional - x64 or x86 architecture, defaults to x64
architecture: 'x64'
# You can test your matrix by printing the current Python version
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install pdoc
run: python -m pip install pdoc3
- name: Generate documentation
run: pdoc --html ariths_gen
- name: Upload results
uses: actions/upload-artifact@v4
with:
name: documentation
path: html
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@4.1.1
with:
branch: gh-pages # The branch the action should deploy to.
folder: html/ariths_gen # The folder the action should deploy.