Skip to content

Commit

Permalink
Build images on push, tweak Yosys installation
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianschuiki committed Nov 25, 2024
1 parent f8fb7de commit 4b38029
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 17 deletions.
26 changes: 18 additions & 8 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
name: Build and push images

on:
push:
paths:
- 'integration_test/**'
pull_request:
release:
types: [published]
workflow_dispatch:

jobs:
build-integration-test-image:
name: Build and push Docker image for integration tests
name: Integration Test Image
runs-on: ubuntu-latest
defaults:
run:
working-directory: integration_test
steps:
- name: Get CIRCT images repo
uses: actions/checkout@v4
- name: Build and push image
working-directory: ./integration_test
- uses: actions/checkout@v4
- name: Setup Environment
run: echo "GIT_TAG=$(echo $GITHUB_REF | cut -d / -f 3)" >> $GITHUB_ENV
- name: Build Image
run: |
docker build . --tag ghcr.io/${{github.repository}}/circt-integration-test:$GIT_TAG
- name: Push Image
if: ${{ github.event_name == 'release' }}
run: |
TAG=$(echo $GITHUB_REF | cut -d / -f 3)
echo ${{ secrets.CR_PAT }} | docker login ghcr.io -u $GITHUB_ACTOR --password-stdin
docker build . --tag ghcr.io/${{github.repository}}/circt-integration-test:$TAG
docker push ghcr.io/${{github.repository}}/circt-integration-test:$TAG
docker push ghcr.io/${{github.repository}}/circt-integration-test:$GIT_TAG
6 changes: 5 additions & 1 deletion integration_test/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ RUN apt-get update && apt-get install -y \
clang-tidy \
curl \
flex \
gawk \
git \
gperf \
libffi-dev \
libfl-dev \
libfl2 \
libreadline-dev \
libssl-dev \
libsystemc-dev \
libtool \
Expand All @@ -29,10 +32,11 @@ RUN apt-get update && apt-get install -y \
pkg-config \
software-properties-common \
tar \
tcl-dev \
unzip \
valgrind \
wget \
yosys
zlib1g-dev

RUN apt-get update && apt-get install -y \
python3.8-dev python3-pip python3.9-dev
Expand Down
17 changes: 9 additions & 8 deletions integration_test/yosys.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@

YOSYS_VER=0.47

mkdir -p /tmp/yosys
cd /tmp/yosys
wget https://github.com/YosysHQ/yosys/releases/download/$YOSYS_VER/yosys.tar.gz
tar -zxf yosys.tar.gz
export PREFIX=/usr
make config-clang
make -j$(nproc)
make install
cd /tmp
wget https://github.com/YosysHQ/yosys/archive/refs/tags/$YOSYS_VER.tar.gz
tar -zxf $YOSYS_VER.tar.gz
rm $YOSYS_VER.tar.gz
cd yosys-$YOSYS_VER
make PREFIX=/usr -j$(nproc)
make PREFIX=/usr install
cd ..
rm -r yosys-$YOSYS_VER
rm -r /tmp/yosys

0 comments on commit 4b38029

Please sign in to comment.