Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci/Tests: use a container image to avoid installing klayout in each job #54

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 23 additions & 24 deletions .github/workflows/Tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ on:
pull_request:
workflow_dispatch:

jobs:
env:
DOCKER_BUILDKIT: 1

jobs:

Test:
runs-on: ubuntu-latest
Expand All @@ -48,36 +50,33 @@ jobs:
name: ${{ matrix.type }} | ${{ matrix.test }}

env:
PDK_ROOT: $GITHUB_WORKSPACE/rules/klayout
PDK: ${{ matrix.pdk }}
IMAGE: ghcr.io/google/globalfoundries-pdk-libs-gf180mcu_fd_pr/test
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the image public?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The image is neither public nor private, because it's not pushed to any registry. It's built in one step and used in the next step, both of them executed within the same job. Therefore, the name might be anything; it's local only.

However, it might make sense to eventually split building the image and using it, in order to avoid installing the dependencies in each job. That's what #55 is about.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah make sense, curious if you consider caching it with docker save/load instead?


steps:

- uses: actions/checkout@v3

- uses: actions/setup-python@v3
with:
python-version: '3.9'
cache: 'pip'
cache-dependency-path: '**/requirements.test.txt'
- name: Build container image
run: |
docker build -t "$IMAGE" -f- rules/klayout <<EOF
FROM gcr.io/hdl-containers/klayout

- run: pip install -r ./rules/klayout/requirements.test.txt
RUN apt-get update -qq \
&& DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends \
make \
procps \
python3-pip \
&& apt-get autoclean && apt-get clean && apt-get -y autoremove \
&& rm -rf /var/lib/apt/lists/*

- name: Installing Klayout 0.27.8
run: |
sudo apt update -qq -y
wget https://www.klayout.org/downloads/Ubuntu-20/klayout_0.27.8-1_amd64.deb
sudo apt install -qq -y \
qt5-default \
qttools5-dev \
libqt5xmlpatterns5-dev \
qtmultimedia5-dev \
libqt5multimediawidgets5 \
libqt5svg5-dev
sudo dpkg -i ./klayout_0.27.8-1_amd64.deb
sudo apt-get install -f -y
RUN --mount=type=bind,target=/tmp/ctx pip3 install -r /tmp/ctx/requirements.test.txt
proppy marked this conversation as resolved.
Show resolved Hide resolved
EOF

- name: Testing ${{ matrix.type }} for ${{ matrix.test }}
run: |
cd ./rules/klayout/${{ matrix.pdk }}/testing
run: >
docker run --rm
-v $(pwd):/wrk -w /wrk/rules/klayout/${{ matrix.pdk }}/testing
-e PDK_ROOT="/wrk/rules/klayout"
-e PDK='${{ matrix.pdk }}'
"$IMAGE"
make test-${{ matrix.type }}-${{ matrix.test }}