|
| 1 | +name: Build and publish ORFS images |
| 2 | +on: |
| 3 | + push: |
| 4 | + paths: |
| 5 | + - etc/DependencyInstaller.sh |
| 6 | + - etc/DockerHelper.sh |
| 7 | + - .github/workflows/github-actions-publish-docker-images.yml |
| 8 | + - build_openroad.sh |
| 9 | + - env.sh |
| 10 | + - flow/Makefile |
| 11 | + - docker/Dockerfile.dev |
| 12 | + - docker/Dockerfile.builder |
| 13 | + - tools/codespace/scripts/** |
| 14 | + - tools/codespace/Dockerfile-lxqt |
| 15 | + pull_request: |
| 16 | + paths: |
| 17 | + - etc/DependencyInstaller.sh |
| 18 | + - etc/DockerHelper.sh |
| 19 | + - .github/workflows/github-actions-publish-docker-images.yml |
| 20 | + - build_openroad.sh |
| 21 | + - env.sh |
| 22 | + - flow/Makefile |
| 23 | + - docker/Dockerfile.dev |
| 24 | + - docker/Dockerfile.builder |
| 25 | + - tools/codespace/scripts/** |
| 26 | + - tools/codespace/Dockerfile-lxqt |
| 27 | + |
| 28 | +jobs: |
| 29 | + buildCodespaceImage: |
| 30 | + runs-on: ubuntu-latest |
| 31 | + timeout-minutes: 600 |
| 32 | + steps: |
| 33 | + - uses: actions/checkout@v4 |
| 34 | + |
| 35 | + - name: Set environment variables |
| 36 | + run: echo "IMAGE=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV |
| 37 | + |
| 38 | + - name: Set up Docker Buildx |
| 39 | + uses: docker/setup-buildx-action@v3 |
| 40 | + |
| 41 | + - name: Login to GitHub Container Registry (GHCR) |
| 42 | + if: github.event_name != 'pull_request' |
| 43 | + uses: docker/login-action@v3 |
| 44 | + with: |
| 45 | + registry: ghcr.io |
| 46 | + username: gha |
| 47 | + password: ${{ github.token }} |
| 48 | + |
| 49 | + - name: Build and export codespaces image |
| 50 | + uses: docker/build-push-action@v6 |
| 51 | + with: |
| 52 | + context: . |
| 53 | + push: true |
| 54 | + tags: ${{ env.IMAGE }}:lxqt |
| 55 | + file: tools/codespace/Dockerfile-lxqt |
| 56 | + cache-from: type=registry,ref=${{ env.IMAGE }}:lxqtbuildcache |
| 57 | + cache-to: type=registry,ref=${{ env.IMAGE }}:lxqtbuildcache |
| 58 | + |
| 59 | + buildDependenciesImage: |
| 60 | + strategy: |
| 61 | + fail-fast: false |
| 62 | + matrix: |
| 63 | + os: [["ubuntu20.04", "ubuntu:20.04"], ["ubuntu22.04", "ubuntu:22.04"]] |
| 64 | + runs-on: ubuntu-latest |
| 65 | + steps: |
| 66 | + - name: Check out repository code |
| 67 | + uses: actions/checkout@v4 |
| 68 | + with: |
| 69 | + fetch-depth: 1 |
| 70 | + submodules: recursive |
| 71 | + |
| 72 | + - name: Set environment variables |
| 73 | + run: | |
| 74 | + echo "IMAGE_DEPS=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')-dev/${{ matrix.os[0] }}" >> $GITHUB_ENV |
| 75 | +
|
| 76 | + - name: Set up Docker Buildx |
| 77 | + uses: docker/setup-buildx-action@v3 |
| 78 | + |
| 79 | + - name: Login to GitHub Container Registry (GHCR) |
| 80 | + if: github.event_name != 'pull_request' |
| 81 | + uses: docker/login-action@v2 |
| 82 | + with: |
| 83 | + registry: ghcr.io |
| 84 | + username: gha |
| 85 | + password: ${{ github.token }} |
| 86 | + |
| 87 | + - name: Copy OpenROAD installer |
| 88 | + run: cp tools/OpenROAD/etc/DependencyInstaller.sh etc/InstallerOpenROAD.sh |
| 89 | + |
| 90 | + - name: Build and export dependencies image |
| 91 | + uses: docker/build-push-action@v6 |
| 92 | + with: |
| 93 | + context: etc |
| 94 | + push: true |
| 95 | + tags: ${{ env.IMAGE_DEPS }}:latest |
| 96 | + file: docker/Dockerfile.dev |
| 97 | + build-args: | |
| 98 | + fromImage=${{ matrix.os[1] }} |
| 99 | + cache-from: type=registry,ref=${{ env.IMAGE_DEPS }}:buildcache |
| 100 | + cache-to: type=registry,ref=${{ env.IMAGE_DEPS }}:buildcache,mode=max |
| 101 | + |
| 102 | + buildORFSImage: |
| 103 | + needs: buildDependenciesImage |
| 104 | + strategy: |
| 105 | + fail-fast: false |
| 106 | + matrix: |
| 107 | + os: ["ubuntu20.04", "ubuntu22.04"] |
| 108 | + runs-on: ubuntu-latest |
| 109 | + steps: |
| 110 | + - name: Free Disk Space |
| 111 | + uses: jlumbroso/free-disk-space@main |
| 112 | + with: |
| 113 | + tool-cache: false |
| 114 | + |
| 115 | + - name: Check out repository code |
| 116 | + uses: actions/checkout@v4 |
| 117 | + with: |
| 118 | + fetch-depth: 1 |
| 119 | + submodules: recursive |
| 120 | + |
| 121 | + - name: Set environment variables |
| 122 | + run: | |
| 123 | + echo "IMAGE=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')/${{ matrix.os }}" >> $GITHUB_ENV |
| 124 | + echo "IMAGE_DEPS=ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')-dev/${{ matrix.os }}" >> $GITHUB_ENV |
| 125 | + echo "NUM_THREADS=$(nproc)" >> $GITHUB_ENV |
| 126 | +
|
| 127 | + - name: Set up Docker Buildx |
| 128 | + uses: docker/setup-buildx-action@v3 |
| 129 | + |
| 130 | + - name: Login to GitHub Container Registry (GHCR) |
| 131 | + if: github.event_name != 'pull_request' |
| 132 | + uses: docker/login-action@v2 |
| 133 | + with: |
| 134 | + registry: ghcr.io |
| 135 | + username: gha |
| 136 | + password: ${{ github.token }} |
| 137 | + |
| 138 | + - name: Build and export ORFS image |
| 139 | + uses: docker/build-push-action@v6 |
| 140 | + with: |
| 141 | + context: . |
| 142 | + push: true |
| 143 | + tags: ${{ env.IMAGE }}:latest |
| 144 | + file: docker/Dockerfile.builder |
| 145 | + build-args: | |
| 146 | + fromImage=${{ env.IMAGE_DEPS }} |
| 147 | + numThreads=${{ env.NUM_THREADS }} |
| 148 | + cache-from: type=registry,ref=${{ env.IMAGE }}:buildcache |
| 149 | + cache-to: type=registry,ref=${{ env.IMAGE }}:buildcache,mode=max |
0 commit comments