Skip to content

Commit

Permalink
ci: get fuel-core version from an env variable (#5486)
Browse files Browse the repository at this point in the history
## Description
Closes #5393 

Use consistent version of fuel-core in debugger CI tests from an env
variable `FUEL_CORE_VERSION`

## Checklist

- [ ] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [ ] I have requested a review from the relevant team or maintainers.
  • Loading branch information
levisyin authored Jan 19, 2024
1 parent 81bee2a commit 546bd99
Showing 1 changed file with 24 additions and 2 deletions.
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

0 comments on commit 546bd99

Please sign in to comment.