From 4b380299b520dbe80529ffdd849866f472c61e89 Mon Sep 17 00:00:00 2001 From: Fabian Schuiki Date: Mon, 25 Nov 2024 12:21:36 -0800 Subject: [PATCH] Build images on push, tweak Yosys installation --- .github/workflows/integration_tests.yml | 26 +++++++++++++++++-------- integration_test/Dockerfile | 6 +++++- integration_test/yosys.sh | 17 ++++++++-------- 3 files changed, 32 insertions(+), 17 deletions(-) diff --git a/.github/workflows/integration_tests.yml b/.github/workflows/integration_tests.yml index 559dc42..f9c6936 100644 --- a/.github/workflows/integration_tests.yml +++ b/.github/workflows/integration_tests.yml @@ -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 diff --git a/integration_test/Dockerfile b/integration_test/Dockerfile index 4310c03..f4d9e9f 100644 --- a/integration_test/Dockerfile +++ b/integration_test/Dockerfile @@ -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 \ @@ -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 diff --git a/integration_test/yosys.sh b/integration_test/yosys.sh index d05a5ab..353abcc 100755 --- a/integration_test/yosys.sh +++ b/integration_test/yosys.sh @@ -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