-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into secure-pin-swap-fix…
…-flow
- Loading branch information
Showing
11 changed files
with
407 additions
and
289 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
131 changes: 131 additions & 0 deletions
131
.github/workflows/github-actions-publish-docker-images.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
name: Build and publish ORFS images | ||
on: | ||
push: | ||
paths: | ||
- etc/DependencyInstaller.sh | ||
- etc/DockerHelper.sh | ||
- .github/workflows/github-actions-publish-docker-images.yml | ||
- build_openroad.sh | ||
- env.sh | ||
- flow/Makefile | ||
- docker/Dockerfile.dev | ||
- docker/Dockerfile.builder | ||
pull_request: | ||
paths: | ||
- etc/DependencyInstaller.sh | ||
- etc/DockerHelper.sh | ||
- .github/workflows/github-actions-publish-docker-images.yml | ||
- build_openroad.sh | ||
- env.sh | ||
- flow/Makefile | ||
- docker/Dockerfile.dev | ||
- docker/Dockerfile.builder | ||
|
||
jobs: | ||
buildDependenciesImage: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [["ubuntu20.04", "ubuntu:20.04"], ["ubuntu22.04", "ubuntu:22.04"]] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
submodules: recursive | ||
|
||
- name: Set environment variables | ||
run: | | ||
echo "IMAGE_DEPS=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')-dev/${{ matrix.os[0] }}" >> $GITHUB_ENV | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Login to GitHub Container Registry (GHCR) | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: gha | ||
password: ${{ github.token }} | ||
|
||
- name: Copy OpenROAD installer | ||
run: cp tools/OpenROAD/etc/DependencyInstaller.sh etc/InstallerOpenROAD.sh | ||
|
||
- name: Build and export dependencies image | ||
uses: docker/build-push-action@v6 | ||
with: | ||
context: etc | ||
push: true | ||
tags: ${{ env.IMAGE_DEPS }}:latest | ||
file: docker/Dockerfile.dev | ||
build-args: | | ||
fromImage=${{ matrix.os[1] }} | ||
numThreads=$(nproc) | ||
cache-from: type=registry,ref=${{ env.IMAGE_DEPS }}:buildcache | ||
cache-to: type=registry,ref=${{ env.IMAGE_DEPS }}:buildcache,mode=max | ||
|
||
buildORFSImage: | ||
needs: buildDependenciesImage | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: ["ubuntu20.04", "ubuntu22.04"] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Free Disk Space | ||
uses: jlumbroso/free-disk-space@main | ||
with: | ||
tool-cache: false | ||
|
||
- name: Check out repository code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
submodules: recursive | ||
|
||
- name: Set environment variables | ||
run: | | ||
echo "IMAGE=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')/${{ matrix.os }}" >> $GITHUB_ENV | ||
echo "IMAGE_DEPS=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')-dev/${{ matrix.os }}" >> $GITHUB_ENV | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
# We don't use the build-push-action here because it hangs | ||
- name: Build ORFS image | ||
run: | | ||
docker buildx build \ | ||
--load \ | ||
--build-arg fromImage=${{ env.IMAGE_DEPS }}:latest \ | ||
--build-arg numThreads=$(nproc) \ | ||
--cache-from type=registry,ref=${{ env.IMAGE }}:buildcache \ | ||
--tag ${{ env.IMAGE }}:latest \ | ||
--file docker/Dockerfile.builder \ | ||
. | ||
- name: Test build | ||
run: | | ||
cmd="source ./env.sh && yosys -help && openroad -help && make -C flow ;" | ||
docker run ${{ env.IMAGE }}:latest /bin/bash -c "${cmd}" | ||
- name: Login to GitHub Container Registry (GHCR) | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: gha | ||
password: ${{ github.token }} | ||
|
||
- name: Export ORFS image | ||
run: | | ||
docker buildx build \ | ||
--build-arg fromImage=${{ env.IMAGE_DEPS }}:latest \ | ||
--build-arg numThreads=$(nproc) \ | ||
--cache-from type=registry,ref=${{ env.IMAGE }}:buildcache \ | ||
--cache-to type=registry,ref=${{ env.IMAGE }}:buildcache,mode=max \ | ||
--tag ${{ env.IMAGE }}:latest \ | ||
--file docker/Dockerfile.builder \ | ||
--push \ | ||
. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.