ci: merge workflow pyF4PGA into Pipeline

Signed-off-by: Unai Martinez-Corral <umartinezcorral@antmicro.com>
This commit is contained in:
Unai Martinez-Corral 2022-04-24 02:38:17 +02:00
parent c44a0e164c
commit 382e09b307
3 changed files with 54 additions and 68 deletions

View File

@ -21,12 +21,13 @@ on:
jobs:
Docs:
runs-on: ubuntu-latest
name: '📓 Docs'
steps:
- name: '🧰 Checkout'
- name: 🧰 Checkout
uses: actions/checkout@v3
with:
submodules: recursive
@ -62,28 +63,28 @@ jobs:
git push -u origin +HEAD:gh-pages
Example:
Deprecated:
runs-on: ubuntu-latest
name: '🐍 Example'
strategy:
fail-fast: false
matrix:
include:
- { fam: xc7, example: counter_test }
- { fam: eos-s3, example: btn_counter }
name: '🚦 Example (deprecated sh) | ${{ matrix.fam }}'
env:
F4PGA_INSTALL_DIR: /opt/f4pga
F4PGA_FAM: ${{ matrix.fam }}
steps:
- name: '🧰 Checkout'
- name: 🧰 Checkout
uses: actions/checkout@v3
- name: '🔧 Prepare environment'
- name: 🔧 Prepare environment
run: ./.github/scripts/prepare_environment.sh
- name: '🐍 Install f4pga (pip)'
- name: 🐍 Install f4pga (pip)
run: |
. ./.github/scripts/activate.sh
@ -91,14 +92,14 @@ jobs:
pip install --use-feature=in-tree-build .
cd ..
- name: '🚧 Test f4pga-env'
- name: 🚧 Test f4pga-env
run: |
. ./.github/scripts/activate.sh
echo "F4PGA_ENV_BIN=$(f4pga-env bin)" >> "$GITHUB_ENV"
echo "F4PGA_ENV_SHARE=$(f4pga-env share)" >> "$GITHUB_ENV"
- name: '🚧 Test make example'
- name: 🚧 Test make example
run: |
. ./.github/scripts/activate.sh
@ -127,3 +128,47 @@ jobs:
name: eos-s3-Bitstream
path: f4pga-examples/eos-s3/btn_counter/build/top.bit
if-no-files-found: error
pyF4PGA:
runs-on: ubuntu-latest
name: '🐍 Example'
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 ..
- name: 🚧 Test py4FPGA build
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
- name: Test py4FPGA (PYTHONPATH)
run: |
PYTHONPATH=$(pwd) python3 f4pga/__init__.py
PYTHONPATH=$(pwd) python3 f4pga/__init__.py -h

View File

@ -1,59 +0,0 @@
name: py4FPGA
on:
push:
pull_request:
jobs:
Test-pip:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
# with:
# submodules: recursive
- name: Prepare environment
run: |
sudo apt update -y
sudo apt install -y git wget xz-utils
git clone --recurse-submodules https://github.com/chipsalliance/f4pga-examples
cd f4pga-examples
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O conda_installer.sh
export INSTALL_DIR=/opt/f4pga
bash conda_installer.sh -u -b -p $INSTALL_DIR/xc7/conda
source "$INSTALL_DIR/xc7/conda/etc/profile.d/conda.sh"
conda env create -f xc7/environment.yml
mkdir -p $INSTALL_DIR/xc7/install
wget -qO- https://storage.googleapis.com/symbiflow-arch-defs/artifacts/prod/foss-fpga-tools/symbiflow-arch-defs/continuous/install/535/20220128-000432/symbiflow-arch-defs-install-5fa5e715.tar.xz | tar -xJC $INSTALL_DIR/xc7/install
wget -qO- https://storage.googleapis.com/symbiflow-arch-defs/artifacts/prod/foss-fpga-tools/symbiflow-arch-defs/continuous/install/535/20220128-000432/symbiflow-arch-defs-xc7a50t_test-5fa5e715.tar.xz | tar -xJC $INSTALL_DIR/xc7/install
- name: Test py4FPGA build
run: |
export INSTALL_DIR=/opt/f4pga
export PATH="$INSTALL_DIR/xc7/install/bin:$PATH";
source "$INSTALL_DIR/xc7/conda/etc/profile.d/conda.sh"
conda activate xc7
cd f4pga
pip install --use-feature=in-tree-build .
cd ..
cd f4pga-examples
f4pga build --flow ../.github/sftest.json -t bitstream
- name: Test py4FPGA (PYTHONPATH)
run: |
PYTHONPATH=$(pwd) python3 f4pga/__init__.py
PYTHONPATH=$(pwd) python3 f4pga/__init__.py -h

View File

@ -57,7 +57,7 @@ SYMBICACHEPATH = '.symbicache'
binpath = os.path.realpath(os.path.join(os.path.dirname(os.path.realpath(os.sys.argv[0])), '..'))
mypath = str(Path(__file__).resolve().parent)
share_dir_path = os.path.realpath(f"{environ.get('INSTALL_DIR', '/usr/local')}/xc7/install/share/symbiflow")
share_dir_path = os.path.realpath(f"{environ.get('F4PGA_INSTALL_DIR', '/usr/local')}/xc7/install/share/symbiflow")
class DependencyNotProducedException(Exception):
dep_name: str