mirror of
https://github.com/ehw-fit/ariths-gen.git
synced 2025-04-04 06:11:41 +01:00
131 lines
3.9 KiB
YAML
131 lines
3.9 KiB
YAML
# 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@v2
|
|
- name: Set up Python 3.x
|
|
uses: actions/setup-python@v2
|
|
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@v1.0.0
|
|
with:
|
|
name: arithmetic-circuits-8
|
|
path: test_circuits
|
|
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Install iverilog
|
|
run: sudo apt install iverilog
|
|
- name: Set up Python 3.x
|
|
uses: actions/setup-python@v2
|
|
- run: python -m pip install numpy
|
|
- name: Download workflow run artifacts
|
|
uses: actions/download-artifact@v2
|
|
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 ..
|
|
|
|
test_python:
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
strategy:
|
|
matrix:
|
|
python-version: [ '3.6.x', '3.7.x', '3.8.x', '3.9.x', '3.10.0-rc.2' ]
|
|
name: Python ${{ matrix.python-version }} test
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: Setup python
|
|
uses: actions/setup-python@v2
|
|
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@v2
|
|
- name: Set up Python 3.x
|
|
uses: actions/setup-python@v2
|
|
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@v1.0.0
|
|
with:
|
|
name: documentation
|
|
path: html
|
|
- name: Deploy 🚀
|
|
uses: JamesIves/github-pages-deploy-action@4.1.4
|
|
with:
|
|
branch: gh-pages # The branch the action should deploy to.
|
|
folder: html/ariths_gen # The folder the action should deploy. |