2022-03-19 23:36:21 -04:00
|
|
|
# Copyright (C) 2020-2022 F4PGA Authors.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# https://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
2022-02-27 09:27:49 -05:00
|
|
|
name: Pipeline
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
2022-04-23 20:38:17 -04:00
|
|
|
|
2022-02-27 09:27:49 -05:00
|
|
|
Docs:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: '📓 Docs'
|
|
|
|
steps:
|
|
|
|
|
2022-04-23 20:38:17 -04:00
|
|
|
- name: 🧰 Checkout
|
2022-02-27 09:27:49 -05:00
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
submodules: recursive
|
|
|
|
|
|
|
|
- name: 🛠️ Setup environment
|
|
|
|
run: |
|
|
|
|
sudo apt update -qq
|
|
|
|
sudo apt install -y make
|
2022-03-08 20:11:44 -05:00
|
|
|
make -C docs env
|
2022-02-27 09:27:49 -05:00
|
|
|
|
|
|
|
- name: 📓 Build the documentation
|
|
|
|
run: |
|
2022-03-08 20:11:44 -05:00
|
|
|
. ./docs/env/conda/bin/activate f4pga-docs
|
|
|
|
make -C docs html
|
2022-02-27 09:27:49 -05:00
|
|
|
|
|
|
|
- name: '📤 Upload artifact: Sphinx HTML'
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: Documentation-HTML
|
2022-03-08 20:11:44 -05:00
|
|
|
path: docs/_build/html
|
2022-02-27 09:27:49 -05:00
|
|
|
|
|
|
|
- name: 🚀 Publish site to GitHub Pages
|
|
|
|
if: github.event_name != 'pull_request'
|
|
|
|
run: |
|
2022-03-08 20:11:44 -05:00
|
|
|
cd docs/_build/html
|
2022-02-27 09:27:49 -05:00
|
|
|
touch .nojekyll
|
|
|
|
git init
|
2022-03-08 20:11:44 -05:00
|
|
|
cp ../../../.git/config ./.git/config
|
2022-02-27 09:27:49 -05:00
|
|
|
git add .
|
|
|
|
git config --local user.email "BuildTheDocs@GitHubActions"
|
|
|
|
git config --local user.name "GitHub Actions"
|
|
|
|
git commit -a -m "update ${{ github.sha }}"
|
|
|
|
git push -u origin +HEAD:gh-pages
|
|
|
|
|
|
|
|
|
2022-04-23 20:38:17 -04:00
|
|
|
Deprecated:
|
2022-02-27 09:27:49 -05:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- { fam: xc7, example: counter_test }
|
|
|
|
- { fam: eos-s3, example: btn_counter }
|
2022-04-23 20:38:17 -04:00
|
|
|
name: '🚦 Example (deprecated sh) | ${{ matrix.fam }}'
|
2022-02-27 09:27:49 -05:00
|
|
|
env:
|
|
|
|
F4PGA_INSTALL_DIR: /opt/f4pga
|
|
|
|
F4PGA_FAM: ${{ matrix.fam }}
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
2022-04-23 20:38:17 -04:00
|
|
|
- name: 🧰 Checkout
|
2022-02-27 09:27:49 -05:00
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
2022-04-23 20:38:17 -04:00
|
|
|
- name: 🔧 Prepare environment
|
2022-02-27 09:27:49 -05:00
|
|
|
run: ./.github/scripts/prepare_environment.sh
|
|
|
|
|
2022-04-23 20:38:17 -04:00
|
|
|
- name: 🐍 Install f4pga (pip)
|
2022-03-19 22:59:49 -04:00
|
|
|
run: |
|
|
|
|
. ./.github/scripts/activate.sh
|
|
|
|
|
|
|
|
cd f4pga
|
2022-05-12 13:53:05 -04:00
|
|
|
pip install .
|
2022-03-19 22:59:49 -04:00
|
|
|
cd ..
|
|
|
|
|
2022-04-23 20:38:17 -04:00
|
|
|
- name: 🚧 Test f4pga-env
|
2022-03-19 21:28:04 -04:00
|
|
|
run: |
|
|
|
|
. ./.github/scripts/activate.sh
|
|
|
|
|
2022-04-21 07:25:25 -04:00
|
|
|
echo "F4PGA_ENV_BIN=$(f4pga-env bin)" >> "$GITHUB_ENV"
|
|
|
|
echo "F4PGA_ENV_SHARE=$(f4pga-env share)" >> "$GITHUB_ENV"
|
2022-03-19 21:28:04 -04:00
|
|
|
|
2022-04-23 20:38:17 -04:00
|
|
|
- name: 🚧 Test make example
|
2022-02-27 09:27:49 -05:00
|
|
|
run: |
|
|
|
|
. ./.github/scripts/activate.sh
|
|
|
|
|
|
|
|
export VPRPATH=$(f4pga-env bin)
|
|
|
|
|
|
|
|
cd f4pga-examples
|
|
|
|
cd ${{ matrix.fam }}
|
|
|
|
|
|
|
|
case '${{ matrix.fam }}' in
|
|
|
|
xc7) TARGET="arty_35" make -C counter_test;;
|
|
|
|
eos-s3) make -C btn_counter;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
- name: '📤 Upload artifact: Arty 35 bitstream'
|
|
|
|
if: matrix.fam == 'xc7'
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: arty_35-Bitstream
|
|
|
|
path: f4pga-examples/xc7/counter_test/build/arty_35/top.bit
|
|
|
|
if-no-files-found: error
|
|
|
|
|
|
|
|
- name: '📤 Upload artifact: QuickLogic bitstream'
|
|
|
|
if: matrix.fam == 'eos-s3'
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: eos-s3-Bitstream
|
|
|
|
path: f4pga-examples/eos-s3/btn_counter/build/top.bit
|
|
|
|
if-no-files-found: error
|
2022-04-23 20:38:17 -04:00
|
|
|
|
|
|
|
|
|
|
|
pyF4PGA:
|
|
|
|
runs-on: ubuntu-latest
|
2022-03-03 18:15:32 -05:00
|
|
|
name: '🐍 Example | xc7'
|
2022-04-23 20:38:17 -04:00
|
|
|
env:
|
|
|
|
F4PGA_INSTALL_DIR: /opt/f4pga
|
|
|
|
F4PGA_FAM: xc7
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: 🧰 Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
# with:
|
|
|
|
# submodules: recursive
|
|
|
|
|
|
|
|
- name: 🔧 Prepare environment
|
|
|
|
run: ./.github/scripts/prepare_environment.sh
|
|
|
|
|
|
|
|
- name: 🐍 Install f4pga (pip)
|
|
|
|
run: |
|
|
|
|
. ./.github/scripts/activate.sh
|
|
|
|
|
|
|
|
cd f4pga
|
|
|
|
pip install --use-feature=in-tree-build .
|
|
|
|
cd ..
|
|
|
|
|
2022-03-03 18:15:32 -05:00
|
|
|
- name: 🚧 Test f4pga build
|
2022-04-23 20:38:17 -04:00
|
|
|
run: |
|
|
|
|
. ./.github/scripts/activate.sh
|
|
|
|
|
|
|
|
cd f4pga-examples
|
|
|
|
f4pga build --flow ../.github/sftest.json -t bitstream
|
|
|
|
|
|
|
|
- name: '📤 Upload artifact: Arty 35 bitstream'
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: arty_35-Bitstream-pyF4PGA
|
|
|
|
path: f4pga-examples/build/arty_35/top.bit
|
|
|
|
|
2022-03-03 18:15:32 -05:00
|
|
|
|
|
|
|
PYTHONPATH:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: '🐍 PYTHONPATH'
|
|
|
|
env:
|
|
|
|
F4PGA_INSTALL_DIR: /opt/f4pga
|
|
|
|
F4PGA_FAM: xc7
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: 🧰 Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: 🚧 Test pyF4PGA (PYTHONPATH)
|
2022-04-23 20:38:17 -04:00
|
|
|
run: |
|
|
|
|
PYTHONPATH=$(pwd) python3 f4pga/__init__.py
|
|
|
|
PYTHONPATH=$(pwd) python3 f4pga/__init__.py -h
|
2022-03-03 18:15:32 -05:00
|
|
|
|
|
|
|
|
|
|
|
pyWrappers:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
name: '🐍 Python wrappers'
|
|
|
|
env:
|
|
|
|
F4PGA_INSTALL_DIR: /opt/f4pga
|
|
|
|
F4PGA_FAM: xc7
|
|
|
|
|
|
|
|
steps:
|
|
|
|
|
|
|
|
- name: 🧰 Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: 🔧 Prepare environment
|
|
|
|
run: ./.github/scripts/prepare_environment.sh
|
|
|
|
|
|
|
|
- name: 🐍 Install f4pga (pip)
|
|
|
|
run: |
|
|
|
|
. ./.github/scripts/activate.sh
|
|
|
|
|
|
|
|
cd f4pga
|
|
|
|
pip install --use-feature=in-tree-build .
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
- name: 🚦 Test Python wrappers
|
|
|
|
run: |
|
|
|
|
. ./.github/scripts/activate.sh
|
|
|
|
|
2022-03-17 23:09:00 -04:00
|
|
|
pip3 install -r ./test/requirements.txt
|
2022-05-22 08:25:16 -04:00
|
|
|
pytest --verbose --capture=no -rA --color=yes test/
|