File tree Expand file tree Collapse file tree 4 files changed +62
-16
lines changed Expand file tree Collapse file tree 4 files changed +62
-16
lines changed Original file line number Diff line number Diff line change 55 branches : [main]
66
77jobs :
8+ matrix-prep :
9+ runs-on : ubuntu-latest
10+ outputs :
11+ matrix : ${{ steps.set-matrix.outputs.matrix }}
12+ steps :
13+ - name : Read config from matrix.json
14+ uses : actions/checkout@v2
15+ - id : set-matrix
16+ run : |
17+ TASKS=$(echo $(cat .github/workflows/matrix.json) | sed 's/ //g' )
18+ echo "::set-output name=matrix::$TASKS"
19+
820 build :
9- runs-on : ubuntu-18.04
21+ needs : matrix-prep
22+ strategy :
23+ matrix : ${{ fromJson(needs.matrix-prep.outputs.matrix) }}
24+ runs-on : ubuntu-${{ matrix.OPERATING_SYSTEM_TAG }}
1025 container :
11- # It is impossible to parametrize image via workflow environment,
12- # so its name is hard-coded.
13- # https://github.com/actions/runner/issues/480
14- image : ghcr.io/unittestbot/utbotcpp/base_env:24-11-2021
26+ image : ghcr.io/unittestbot/utbotcpp/base_env:${{ matrix.DOCKER_TAG }}
1527 credentials :
1628 username : ${{ github.actor }}
1729 password : ${{ secrets.GITHUB_TOKEN }}
2032 UTBOT_INSTALL_DIR : /utbot_distr/install
2133 GRPC_PATH : /utbot_distr/install
2234 CLI_PATH : /utbot_distr/cli
23- DOCKER_TAG : 24-11-2021
35+ DOCKER_TAG : ${{ matrix.DOCKER_TAG }}
2436 ARTIFACT_DIR : utbot-artifact
2537 steps :
2638 - name : Checkout repository
Original file line number Diff line number Diff line change 1+ {
2+ "include" : [
3+ {
4+ "DOCKER_TAG" : " 24-11-2021" ,
5+ "OPERATING_SYSTEM_TAG" : " 18.04"
6+ }
7+ ]
8+ }
Original file line number Diff line number Diff line change 55env :
66 REGISTRY : ghcr.io
77 IMAGE_NAME : base_env
8- TAG : 24-11-2021
98
109jobs :
10+ matrix-prep :
11+ runs-on : ubuntu-latest
12+ outputs :
13+ matrix : ${{ steps.set-matrix.outputs.matrix }}
14+ steps :
15+ - name : Read config from matrix.json
16+ uses : actions/checkout@v2
17+ - id : set-matrix
18+ run : |
19+ TASKS=$(echo $(cat .github/workflows/matrix.json) | sed 's/ //g' )
20+ echo "::set-output name=matrix::$TASKS"
21+
1122 build-docker :
12- runs-on : ubuntu-18.04
23+ needs : matrix-prep
24+ strategy :
25+ matrix : ${{ fromJson(needs.matrix-prep.outputs.matrix) }}
26+ runs-on : ubuntu-${{ matrix.OPERATING_SYSTEM_TAG }}
1327 permissions :
1428 contents : read
1529 packages : write
3145 uses : actions/cache@v2
3246 with :
3347 path : /tmp/.buildx-cache
34- key : ${{ runner.os }}-buildx-${{env.IMAGE_NAME}}-${{ env.TAG }}
48+ key : ${{ runner.os }}-buildx-${{env.IMAGE_NAME}}-${{ matrix.DOCKER_TAG }}
3549 restore-keys : |
3650 ${{ runner.os }}-buildx-buildx
3751
4155 with :
4256 images : ${{env.REGISTRY}}/${{github.repository}}/${{env.IMAGE_NAME}}
4357 tags : |
44- type=raw,value=${{ env.TAG }}
58+ type=raw,value=${{ matrix.DOCKER_TAG }}
4559
4660 - name : Build and push image
4761 uses : docker/build-push-action@v2
5569 cache-from : type=local,src=/tmp/.buildx-cache
5670 cache-to : type=local,dest=/tmp/.buildx-cache-new
5771 build-args : |
58- OPERATING_SYSTEM_TAG=18.04
72+ OPERATING_SYSTEM_TAG=${{ matrix.OPERATING_SYSTEM_TAG }}
5973 # Temp fix
6074 # https://github.com/docker/build-push-action/issues/252
6175 # https://github.com/moby/buildkit/issues/1896
Original file line number Diff line number Diff line change 55 branches : [main]
66
77jobs :
8+ matrix-prep :
9+ runs-on : ubuntu-latest
10+ outputs :
11+ matrix : ${{ steps.set-matrix.outputs.matrix }}
12+ steps :
13+ - name : Read config from matrix.json
14+ uses : actions/checkout@v2
15+ - id : set-matrix
16+ run : |
17+ TASKS=$(echo $(cat .github/workflows/matrix.json) | sed 's/ //g' )
18+ echo "::set-output name=matrix::$TASKS"
19+
820 publish :
9- runs-on : ubuntu-18.04
21+ needs : matrix-prep
22+ strategy :
23+ matrix : ${{ fromJson(needs.matrix-prep.outputs.matrix) }}
24+ runs-on : ubuntu-${{ matrix.OPERATING_SYSTEM_TAG }}
1025 env :
1126 # Environment for the job and for the container is, sadly, duplicated
1227 # https://github.com/docker/compose/issues/1837
1328 VERSION : ${{ format('1.0.{0}', github.run_number) }}
1429 ARTIFACT_DIR : utbot-artifact
1530 container :
16- # It is impossible to parametrize image via workflow environment,
17- # so its name is hard-coded.
18- # https://github.com/actions/runner/issues/480
19- image : ghcr.io/unittestbot/utbotcpp/base_env:24-11-2021
31+ image : ghcr.io/unittestbot/utbotcpp/base_env:${{ matrix.DOCKER_TAG }}
2032 credentials :
2133 username : ${{ github.actor }}
2234 password : ${{ secrets.GITHUB_TOKEN }}
You can’t perform that action at this time.
0 commit comments