-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
58 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,13 +5,25 @@ on: | |
branches: [main] | ||
|
||
jobs: | ||
matrix-prep: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- id: set-matrix | ||
uses: JoshuaTheMiller/[email protected] | ||
with: | ||
inputFile: '.github/workflows/matrix.json' | ||
filter: '[?runOnBranch==`${{ github.ref }}` || runOnBranch==`always`]' | ||
|
||
build: | ||
runs-on: ubuntu-18.04 | ||
needs: matrix-prep | ||
strategy: | ||
matrix: ${{ fromJson(needs.matrix-prep.outputs.matrix) }} | ||
runs-on: ubuntu-${{ matrix.OPERATING_SYSTEM_TAG }} | ||
container: | ||
# It is impossible to parametrize image via workflow environment, | ||
# so its name is hard-coded. | ||
# https://github.com/actions/runner/issues/480 | ||
image: ghcr.io/unittestbot/utbotcpp/base_env:24-11-2021 | ||
image: ghcr.io/unittestbot/utbotcpp/base_env:${{ matrix.DOCKER_TAG }} | ||
credentials: | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
@@ -20,7 +32,7 @@ jobs: | |
UTBOT_INSTALL_DIR: /utbot_distr/install | ||
GRPC_PATH: /utbot_distr/install | ||
CLI_PATH: /utbot_distr/cli | ||
DOCKER_TAG: 24-11-2021 | ||
DOCKER_TAG: ${{ matrix.DOCKER_TAG }} | ||
ARTIFACT_DIR: utbot-artifact | ||
steps: | ||
- name: Checkout repository | ||
|
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,4 @@ | ||
{ | ||
"DOCKER_TAG": "24-11-2021", | ||
"OPERATING_SYSTEM_TAG": "18.04" | ||
} |
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 |
---|---|---|
|
@@ -5,11 +5,25 @@ on: | |
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: base_env | ||
TAG: 24-11-2021 | ||
|
||
jobs: | ||
matrix-prep: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- id: set-matrix | ||
uses: JoshuaTheMiller/[email protected] | ||
with: | ||
inputFile: '.github/workflows/matrix.json' | ||
filter: '[?runOnBranch==`${{ github.ref }}` || runOnBranch==`always`]' | ||
|
||
build-docker: | ||
runs-on: ubuntu-18.04 | ||
needs: matrix-prep | ||
strategy: | ||
matrix: ${{ fromJson(needs.matrix-prep.outputs.matrix) }} | ||
runs-on: ubuntu-${{ matrix.OPERATING_SYSTEM_TAG }} | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
@@ -31,7 +45,7 @@ jobs: | |
uses: actions/cache@v2 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{env.IMAGE_NAME}}-${{ env.TAG }} | ||
key: ${{ runner.os }}-buildx-${{env.IMAGE_NAME}}-${{ matrix.DOCKER_TAG }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx-buildx | ||
|
@@ -41,7 +55,7 @@ jobs: | |
with: | ||
images: ${{env.REGISTRY}}/${{github.repository}}/${{env.IMAGE_NAME}} | ||
tags: | | ||
type=raw,value=${{ env.TAG }} | ||
type=raw,value=${{ matrix.DOCKER_TAG }} | ||
- name: Build and push image | ||
uses: docker/build-push-action@v2 | ||
|
@@ -55,7 +69,7 @@ jobs: | |
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache-new | ||
build-args: | | ||
OPERATING_SYSTEM_TAG=18.04 | ||
OPERATING_SYSTEM_TAG=${{ matrix.OPERATING_SYSTEM_TAG }} | ||
# Temp fix | ||
# https://github.com/docker/build-push-action/issues/252 | ||
# https://github.com/moby/buildkit/issues/1896 | ||
|
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 |
---|---|---|
|
@@ -5,18 +5,30 @@ on: | |
branches: [main] | ||
|
||
jobs: | ||
matrix-prep: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- id: set-matrix | ||
uses: JoshuaTheMiller/[email protected] | ||
with: | ||
inputFile: '.github/workflows/matrix.json' | ||
filter: '[?runOnBranch==`${{ github.ref }}` || runOnBranch==`always`]' | ||
|
||
publish: | ||
runs-on: ubuntu-18.04 | ||
needs: matrix-prep | ||
strategy: | ||
matrix: ${{ fromJson(needs.matrix-prep.outputs.matrix) }} | ||
runs-on: ubuntu-${{ matrix.OPERATING_SYSTEM_TAG }} | ||
env: | ||
# Environment for the job and for the container is, sadly, duplicated | ||
# https://github.com/docker/compose/issues/1837 | ||
VERSION: ${{ format('1.0.{0}', github.run_number) }} | ||
ARTIFACT_DIR: utbot-artifact | ||
container: | ||
# It is impossible to parametrize image via workflow environment, | ||
# so its name is hard-coded. | ||
# https://github.com/actions/runner/issues/480 | ||
image: ghcr.io/unittestbot/utbotcpp/base_env:24-11-2021 | ||
image: ghcr.io/unittestbot/utbotcpp/base_env:${{ matrix.DOCKER_TAG }} | ||
credentials: | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|