Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: get fuel-core version from an env variable #5486

Merged
merged 12 commits into from
Jan 19, 2024
26 changes: 24 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,26 @@ env:
NIGHTLY_RUST_VERSION: nightly-2023-12-27

jobs:
get-fuel-core-version:
runs-on: ubuntu-latest
outputs:
fuel_core_version: ${{steps.get_fuel_core_ver.outputs.version}}
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_VERSION }}

- name: get fuel core version
id: get_fuel_core_ver
run: |
cargo install toml-cli
version=$(toml get Cargo.toml workspace.dependencies.fuel-core-client.version | tr -d '"')
echo "version=$version" >> "$GITHUB_OUTPUT"

build-sway-lib-core:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -278,9 +298,10 @@ jobs:

cargo-run-e2e-test:
runs-on: ubuntu-latest
needs: get-fuel-core-version
services:
fuel-core:
image: ghcr.io/fuellabs/fuel-core:v0.22.0
image: ghcr.io/fuellabs/fuel-core:v${{ needs.get-fuel-core-version.outputs.fuel_core_version }}
ports:
- 4000:4000
steps:
Expand Down Expand Up @@ -420,6 +441,7 @@ jobs:

cargo-test-workspace:
runs-on: ubuntu-latest
needs: get-fuel-core-version
steps:
- uses: actions/checkout@v3
- name: Install toolchain
Expand All @@ -430,7 +452,7 @@ jobs:
uses: baptiste0928/cargo-install@v2
with:
crate: fuel-core-bin
version: "0.22"
version: ${{ needs.get-fuel-core-version.outputs.fuel_core_version }}
- uses: Swatinem/rust-cache@v2
- name: Run tests
run: cargo test --locked --release
Expand Down
Loading