Skip to content

Commit

Permalink
Merge pull request #11 from antmicro/umarcor/bump
Browse files Browse the repository at this point in the history
ci: update triggers, combine workflows, use f4pga container, add requirements files...
  • Loading branch information
tmichalak authored Aug 2, 2023
2 parents 84bd2e9 + ac113ec commit 4bb8a25
Show file tree
Hide file tree
Showing 14 changed files with 146 additions and 236 deletions.
2 changes: 1 addition & 1 deletion .ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ build:
- pip3 install -r docs/requirements.txt
script:
- cd docs
- echo -en "\nhtml_js_files = [ '`dirname $CI_FULL_PROJECT_URL`/annotant/docs/annotant.js' ]" >> source/conf.py
- echo -en "\nhtml_js_files = [ '$ANNOTANT' ]" >> source/conf.py
- make html latexpdf
- cp build/latex/*.pdf build/html/
- tar cf ../$CI_DOCS_ARCHIVE -C build/html/ .
Expand Down
25 changes: 0 additions & 25 deletions .github/scripts/activate.sh

This file was deleted.

8 changes: 1 addition & 7 deletions .github/scripts/latex.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,9 @@

set -e

apt-get update -qq
DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
python3-pip \
python3-setuptools \
python3-wheel

cd $(dirname $0)/../../docs

pip3 install --user -r requirements.txt
pip3 install -r requirements.txt

cd build/latex
LATEXMKOPTS='-interaction=nonstopmode' make
Expand Down
73 changes: 0 additions & 73 deletions .github/scripts/prepare_environment.sh

This file was deleted.

2 changes: 1 addition & 1 deletion .github/scripts/sphinx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ set -e

cd $(dirname $0)/../../docs

pip3 install --user -r requirements.txt
pip3 install -r requirements.txt

make html latex
71 changes: 0 additions & 71 deletions .github/workflows/ci.yml

This file was deleted.

43 changes: 0 additions & 43 deletions .github/workflows/ghpages.yml

This file was deleted.

135 changes: 135 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
name: Pipeline


on: [pull_request, push, workflow_dispatch]


jobs:


Tests:

runs-on: ubuntu-latest
name: "Test Python ${{ matrix.python-version }}"
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install dev requirements
run: |
sudo apt-get update -qq
sudo apt-get install -y \
antlr4 \
libantlr4-runtime-dev \
python3-dev \
yosys
python3 -m pip install --upgrade pip wheel setuptools
python3 -m pip install -r dev.requirements.txt
python3 -m pip install git+https://github.com/antmicro/tuttest
- name: Lint with flake8
run: flake8 fpga_topwrap --count --show-source --statistics

- name: Build
run: tuttest README.md | bash -

- name: Test with pytest
run: pytest


Examples:

runs-on: ubuntu-latest
name: 'Example ${{ matrix.example }}'
strategy:
fail-fast: false
matrix:
example:
- HDMI
- PWM

steps:
- uses: actions/checkout@v3

- uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install tuttest and fpga-topwrap
run: |
python3 -m pip install git+https://github.com/antmicro/tuttest
tuttest README.md | bash -
- name: Generate sources for example HDMI setup
if: matrix.example == 'HDMI'
run: |
cd examples/hdmi
tuttest README.md generate | bash -
cd -
- name: Generate sources for and build example PWM setup
if: matrix.example == 'PWM'
run: |
cd examples/pwm
make generate copy_sources
cd -
docker run --rm -i -v $(pwd):/wrk -w /wrk \
gcr.io/hdl-containers/conda/f4pga/xc7/z010 \
bash -le <<'EOF'
pip3 install -r impl.requirements.txt
cd examples/pwm
make zvb
EOF
cp examples/pwm/build/project_1_0/zynq-symbiflow/project_top.bit top.bit
- uses: actions/upload-artifact@v3
if: matrix.example == 'PWM'
with:
name: top.bit
path: top.bit


Docs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- uses: docker://btdi/sphinx:min
with:
args: ./.github/scripts/sphinx.sh

- uses: docker://btdi/latex
with:
args: ./.github/scripts/latex.sh

- name: 'Upload artifact: Sphinx HTML and PDF'
uses: actions/upload-artifact@v3
with:
name: Documentation
path: docs/build/html

- name: Deploy to Github Pages
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
run: |
sudo chown -R $(whoami) docs
cd docs/build/html
touch .nojekyll
git init
cp ../../../.git/config ./.git/config
git add .
git config --local user.email "push@gha"
git config --local user.name "GHA"
git commit -am "update ${{ github.sha }}"
git push -u origin +HEAD:gh-pages
rm -rf .git
2 changes: 2 additions & 0 deletions dev.requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
flake8
pytest
Loading

0 comments on commit 4bb8a25

Please sign in to comment.