Skip to content

Build and test with the latest version of tools set #708

Build and test with the latest version of tools set

Build and test with the latest version of tools set #708

#This flow will build the latest docker image, test the OpenFASOC generators (only drc and lvs for now) in it and if it works, update the readme file and push it to the docker hub for reference
name: Build and test with the latest version of tools set
on:
#push:
#pull_request:
workflow_dispatch:
schedule:
- cron: 0 1 * * * # run at 1 AM UTC
jobs:
build_docker_image:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build the docker image
env:
IMAGE_NAME: msaligane/openfasoc:alpha
run: |
cd $GITHUB_WORKSPACE/docker/conda
docker build -t $IMAGE_NAME .
docker push $IMAGE_NAME
sky130hd_temp:
needs: build_docker_image
runs-on: ubuntu-latest
steps:
- name: Remove unnecessary files
run: |
du . -h
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
du . -h
- name: Checkout repo
uses: actions/checkout@v2
- name: Test sky130hd Temp sensor
env:
IMAGE_NAME: msaligane/openfasoc:alpha
run: |
cd $GITHUB_WORKSPACE
touch file.log
docker run --rm \
-v $PWD:$PWD\
-w $PWD\
$IMAGE_NAME\
bash -c "\
pip3 install -r requirements.txt &&\
cd ./openfasoc/generators/temp-sense-gen &&\
make sky130hd_temp\
" && exit_code=$? | tee -a file.log
if [ $? -ne 0 ]; then exit 1; fi
if grep "\[ERROR\]" file.log; then exit 1; else exit 0; fi
sky130hd_ldoGen:
needs: build_docker_image
runs-on: ubuntu-latest
steps:
- name: Remove unnecessary files
run: |
du . -h
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
du . -h
- name: Checkout repo
uses: actions/checkout@v2
# - name: Test sky130hvl LDO
# env:
# IMAGE_NAME: msaligane/openfasoc:alpha
# run: |
# cd $GITHUB_WORKSPACE
# touch file.log
# docker run --rm \
# -v $PWD:$PWD\
# -w $PWD\
# $IMAGE_NAME\
# bash -c "\
# cp ./.github/scripts/parse_rpt.py ./openfasoc/generators/ldo-gen/. &&\
# pip3 install -r requirements.txt &&\
# cd ./openfasoc/generators/ldo-gen &&\
# make sky130hvl_ldo &&\
# python3 parse_rpt.py sky130hvl_ldo
# " && exit_code=$? | tee -a file.log
# if [ $? -ne 0 ]; then exit 1; fi
# if grep "\[ERROR\]" file.log; then exit 1; else exit 0; fi
cryoGenerator:
needs: build_docker_image
runs-on: ubuntu-latest
strategy:
matrix:
platform: [sky130hd, sky130hs, sky130hvl]
steps:
- name: Remove unnecessary files
run: |
du . -h
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
du . -h
- name: Checkout repo
uses: actions/checkout@v2
- name: Test ${{ matrix.platform }} Cryo Gen
env:
IMAGE_NAME: msaligane/openfasoc:stable
run: |
cd $GITHUB_WORKSPACE
touch file.log
docker run --rm \
-v $PWD:$PWD\
-w $PWD\
$IMAGE_NAME\
bash -c "\
cp ./.github/scripts/parse_rpt.py ./openfasoc/generators/cryo-gen/. &&\
pip3 install -r requirements.txt &&\
cd ./openfasoc/generators/cryo-gen &&\
make ${{ matrix.platform }}_cryo &&\
python3 parse_rpt.py ${{ matrix.platform }}
" && exit_code=$? | tee -a file.log
if [ $? -ne 0 ]; then exit 1; fi
if grep "^Error" file.log; then exit 1; else exit 0; fi
update_readme:
needs: [sky130hd_temp,sky130hd_ldoGen,cryoGenerator,build_docker_image]
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Grep the commit numbers of all dependent tools and update README.rst
env:
IMAGE_NAME: msaligane/openfasoc:alpha
run: |
cd $GITHUB_WORKSPACE
docker run --rm \
-v $PWD:$PWD\
-w $PWD\
$IMAGE_NAME\
bash -c "\
chmod 755 /scripts/extract_conda_versions.sh
/scripts/extract_conda_versions.sh > conda_versions.txt
chmod 755 /scripts/extract_tool_versions.sh
/scripts/extract_tool_versions.sh > versions.txt
/scripts/modify_readme.py"
- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push the docker image
env:
IMAGE_NAME: msaligane/openfasoc:stable
run: |
docker tag msaligane/openfasoc:alpha $IMAGE_NAME
docker push $IMAGE_NAME
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.BOT_TOKEN }}
title: "[BOT] Update successful version records of dependencies to the repository"
author: ${{ secrets.BOT_AUTHOR_LINE }}
committer: ${{ secrets.BOT_AUTHOR_LINE }}
body: |
This is an automated PR.
See the individual commits for details.
commit-message: |
[BOT] Update dependencies successful version records in the repository
branch: versions-update-branch
push-to-fork: ${{ secrets.FORK_NAME }}
delete-branch: true