Skip to content

Commit

Permalink
Make Rust features into GitHub repository variables
Browse files Browse the repository at this point in the history
  • Loading branch information
teor2345 committed Oct 16, 2023
1 parent 9adf299 commit 187acbc
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/sub-build-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,17 @@ on:
rust_lib_backtrace:
required: false
type: string
# defaults to: vars.RUST_LOG
rust_log:
required: false
type: string
default: info
# keep these in sync with:
# https://github.com/ZcashFoundation/zebra/blob/main/docker/Dockerfile#L83
# defaults to: vars.RUST_PROD_FEATURES
features:
required: false
default: "default-release-binaries"
type: string
# defaults to: vars.RUST_TEST_FEATURES and vars.RUST_PROD_FEATURES
test_features:
required: false
default: "lightwalletd-grpc-tests zebra-checkpoints"
type: string
tag_suffix:
required: false
Expand All @@ -49,6 +47,13 @@ on:
description: 'The image digest to be used on a caller workflow'
value: ${{ jobs.build.outputs.image_digest }}


env:
FEATURES: ${{ inputs.features || vars.RUST_PROD_FEATURES }}
TEST_FEATURES: ${{ inputs.test_features || vars.RUST_TEST_FEATURES }}
RUST_LOG: ${{ inputs.rust_log || vars.RUST_LOG }}
CARGO_INCREMENTAL: ${{ vars.CARGO_INCREMENTAL }}

jobs:
build:
name: Build images
Expand Down Expand Up @@ -143,9 +148,9 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
build-args: |
SHORT_SHA=${{ env.GITHUB_SHA_SHORT }}
RUST_LOG=${{ inputs.rust_log }}
FEATURES=${{ inputs.features }}
TEST_FEATURES=${{ inputs.test_features }}
RUST_LOG=${{ env.RUST_LOG }}
FEATURES=${{ env.FEATURES }}
TEST_FEATURES=${{ env.TEST_FEATURES }}
push: true
# Don't read from the cache if the caller disabled it.
# https://docs.docker.com/engine/reference/commandline/buildx_build/#options
Expand Down

0 comments on commit 187acbc

Please sign in to comment.