Skip to content

Commit

Permalink
fix: workaround no global env available in job context for container:…
Browse files Browse the repository at this point in the history
…image
  • Loading branch information
Matthew Orris committed Oct 24, 2023
1 parent e9d4812 commit d94d626
Showing 1 changed file with 34 additions and 23 deletions.
57 changes: 34 additions & 23 deletions .github/workflows/verify-pr-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,21 @@ env:
CI_BASE_IMAGE_VERSION: 1.0.0

jobs:
# container doesn't understand the global env context, we use steps output instead
container-setup:
runs-on: ubuntu-20.04
steps:
- name: Setup Container Name and Version
id: setup-container
run: |
echo "${{env.CI_BASE_IMAGE}}"
echo "${{env.CI_BASE_IMAGE_VERSION}}"
changes:
name: Determine Changed Files
runs-on: ubuntu-20.04
container:
image: ${{env.CI_BASE_IMAGE}}
image: ghcr.io/libertydsnp/frequency/ci-base-image
outputs:
rust: ${{steps.filter.outputs.rust}}
build-binary: ${{steps.filter.outputs.build-binary}}
Expand Down Expand Up @@ -62,7 +72,7 @@ jobs:
name: Clear Metadata Labels
runs-on: ubuntu-20.04
container:
image: ${{env.CI_BASE_IMAGE}}
image: ghcr.io/libertydsnp/frequency/ci-base-image
steps:
- name: Clear Metadata Changed Label
if: contains(github.event.pull_request.labels.*.name, env.PR_LABEL_METADATA_CHANGED)
Expand Down Expand Up @@ -137,7 +147,7 @@ jobs:
branch_alias: pr
runs-on: [self-hosted, Linux, X64, build, v2]
container:
image: ${{env.CI_BASE_IMAGE}}
image: ghcr.io/libertydsnp/frequency/ci-base-image
env:
NETWORK: mainnet
steps:
Expand Down Expand Up @@ -184,7 +194,7 @@ jobs:
name: Check for Vulnerable Crates
runs-on: ubuntu-20.04
container:
image: ${{env.CI_BASE_IMAGE}}
image: ghcr.io/libertydsnp/frequency/ci-base-image
steps:
- name: Check Out Repo
uses: actions/checkout@v4
Expand All @@ -200,25 +210,26 @@ jobs:
if: needs.changes.outputs.rust == 'true'
name: Verify Rust Code Format
runs-on: ubuntu-20.04
container:
image: ${{env.CI_BASE_IMAGE}}
steps:
- name: Check Out Repo
uses: actions/checkout@v4
- name: Check
# Remove these install commands when ci-base-image has nightly toolchain
run: |
rustup toolchain install nightly-2023-07-13
rustup target add x86_64-unknown-linux-gnu --toolchain nightly-2023-07-13
cargo +nightly-2023-07-13 fmt --check
uses: addnab/docker-run-action@v3
with:
image: ${{env.CI_BASE_IMAGE}}
run: |
rustup toolchain install nightly-2023-07-13
rustup target add x86_64-unknown-linux-gnu --toolchain nightly-2023-07-13
cargo +nightly-2023-07-13 fmt --check
lint-rust-code:
needs: changes
if: needs.changes.outputs.rust == 'true'
name: Lint Rust Code
runs-on: [self-hosted, Linux, X64, build, v2]
container:
image: ${{env.CI_BASE_IMAGE}}
image: ghcr.io/libertydsnp/frequency/ci-base-image
steps:
- name: Check Out Repo
uses: actions/checkout@v4
Expand All @@ -238,7 +249,7 @@ jobs:
name: Verify Rust Developer Docs
runs-on: [self-hosted, Linux, X64, build, v2]
container:
image: ${{env.CI_BASE_IMAGE}}
image: ghcr.io/libertydsnp/frequency/ci-base-image
steps:
- name: Check Out Repo
uses: actions/checkout@v4
Expand All @@ -255,7 +266,7 @@ jobs:
name: Verify Rust Packages and Dependencies
runs-on: [self-hosted, Linux, X64, build, v2]
container:
image: ${{env.CI_BASE_IMAGE}}
image: ghcr.io/libertydsnp/frequency/ci-base-image
steps:
- name: Check Out Repo
uses: actions/checkout@v4
Expand All @@ -268,7 +279,7 @@ jobs:
name: Run Rust Tests
runs-on: [self-hosted, Linux, X64, build, v2]
container:
image: ${{env.CI_BASE_IMAGE}}
image: ghcr.io/libertydsnp/frequency/ci-base-image
steps:
- name: Check Out Repo
uses: actions/checkout@v4
Expand All @@ -286,7 +297,7 @@ jobs:
# https://www.pivotaltracker.com/story/show/185045668 is resolved.
runs-on: [self-hosted, Linux, X64, build, v1]
container:
image: ${{env.CI_BASE_IMAGE}}
image: ghcr.io/libertydsnp/frequency/ci-base-image
steps:
- name: Check Out Repo
uses: actions/checkout@v4
Expand Down Expand Up @@ -410,7 +421,7 @@ jobs:
name: Verify JS API Augment
runs-on: ubuntu-20.04
container:
image: ${{env.CI_BASE_IMAGE}}
image: ghcr.io/libertydsnp/frequency/ci-base-image
steps:
- name: Check Out Repo
uses: actions/checkout@v4
Expand Down Expand Up @@ -470,7 +481,7 @@ jobs:
name: Verify Node Docker Images
runs-on: ubuntu-20.04
container:
image: ${{env.CI_BASE_IMAGE}}
image: ghcr.io/libertydsnp/frequency/ci-base-image
steps:
- name: Check Out Repo
uses: actions/checkout@v4
Expand Down Expand Up @@ -525,7 +536,7 @@ jobs:
name: Verify CI Docker Image
runs-on: ubuntu-20.04
container:
image: ${{env.CI_BASE_IMAGE}}
image: ghcr.io/libertydsnp/frequency/ci-base-image
steps:
- name: Check Out Repo
uses: actions/checkout@v4
Expand All @@ -550,7 +561,7 @@ jobs:
name: Execute Binary Checks
runs-on: ubuntu-20.04
container:
image: ${{env.CI_BASE_IMAGE}}
image: ghcr.io/libertydsnp/frequency/ci-base-image
steps:
- name: Check Out Repo
uses: actions/checkout@v4
Expand Down Expand Up @@ -582,7 +593,7 @@ jobs:
name: Check Metadata and Spec Version
runs-on: ubuntu-20.04
container:
image: ${{env.CI_BASE_IMAGE}}
image: ghcr.io/libertydsnp/frequency/ci-base-image
steps:
- name: Check Out Repo
uses: actions/checkout@v4
Expand Down Expand Up @@ -662,7 +673,7 @@ jobs:
name: Run E2E Tests
runs-on: ubuntu-20.04
container:
image: ${{env.CI_BASE_IMAGE}}
image: ghcr.io/libertydsnp/frequency/ci-base-image
steps:
- name: Check Out Repo
uses: actions/checkout@v4
Expand Down Expand Up @@ -736,7 +747,7 @@ jobs:
name: Verify Genesis State
runs-on: ubuntu-20.04
container:
image: ${{env.CI_BASE_IMAGE}}
image: ghcr.io/libertydsnp/frequency/ci-base-image
steps:
- name: Set Env Vars
run: |
Expand Down Expand Up @@ -784,7 +795,7 @@ jobs:
name: Run Benchmarks?
runs-on: ubuntu-20.04
container:
image: ${{env.CI_BASE_IMAGE}}
image: ghcr.io/libertydsnp/frequency/ci-base-image
outputs:
should_run_benchmarks: ${{steps.run-benchmarks.outputs.run}}
pallets: ${{steps.run-benchmarks.outputs.pallets}}
Expand Down

0 comments on commit d94d626

Please sign in to comment.