Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
v0.1.0-isolate-crates (#319)
Browse files Browse the repository at this point in the history
* Fix database-types

* Build crates in isolation

* Add DASEL_VERSION

* Remove --all-features test from cargo-verifications

Co-authored-by: Rashad Alston <[email protected]>
  • Loading branch information
ra0x3 and Rashad Alston authored Nov 3, 2022
1 parent 122ad71 commit 0522ce0
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 23 deletions.
44 changes: 25 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:

env:
DATABASE_URL: postgres://postgres:my-secret@localhost:5432
DASEL_VERSION: https://github.com/TomWright/dasel/releases/download/v1.24.3/dasel_linux_amd64
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings
REGISTRY: ghcr.io
Expand Down Expand Up @@ -128,8 +129,21 @@ jobs:
with:
command: build
args: -p fuel-indexer-test --release --target wasm32-unknown-unknown
env:
RUSTFLAGS: '-D warnings'

get-workspace-members:
runs-on: ubuntu-latest
outputs:
members: ${{ steps.set-members.outputs.members }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- id: set-members
run: |
# install dasel
curl -sSLf "$DASEL_VERSION" -L -o dasel && chmod +x dasel
mv ./dasel /usr/local/bin/dasel
members=$(cat Cargo.toml | dasel -r toml -w json 'workspace.members' | jq -r ".[]" | xargs -I '{}' dasel -f {}/Cargo.toml 'package.name' | jq -R '[.]' | jq -s -c 'add')
echo "members=$members" >> $GITHUB_OUTPUT
cargo-verifications:
runs-on: ubuntu-latest
Expand All @@ -147,33 +161,24 @@ jobs:
- cancel-previous-runs
- cargo-toml-fmt-check
- cargo-build-wasm-example
- get-workspace-members
strategy:
matrix:
package: ${{fromJSON(needs.get-workspace-members.outputs.members)}}
include:
- command: fmt
args: --all --verbose -- --check
env:
RUSTFLAGS: '-D warnings'
- command: clippy
args: --all-features --all-targets
env:
RUSTFLAGS: '-D warnings'
- command: check
args: --locked --workspace --all-features --all-targets
env:
RUSTFLAGS: '-D warnings'
args: --all-features --locked --workspace --all-targets
- command: build
args: --locked --workspace --all-features --all-targets
env:
RUSTFLAGS: '-D warnings'
- command: test
args: --locked --workspace
env:
RUSTFLAGS: '-D warnings'
- command: test
args: --locked --all-targets --no-default-features --workspace
env:
RUSTFLAGS: '-D warnings'

# disallow any job that takes longer than 45 minutes
timeout-minutes: 45
continue-on-error: ${{ matrix.skip-error || false }}
Expand Down Expand Up @@ -316,7 +321,7 @@ jobs:
- name: Build fuel-indexer
run: |
cross build --profile=release --target ${{ matrix.job.target }} -p fuel-indexer -p fuel-indexer-api-server
- name: Strip release binary linux x86_64
if: matrix.job.platform == 'linux'
run: strip "target/${{ matrix.job.target }}/release/fuel-indexer"
Expand Down Expand Up @@ -495,7 +500,7 @@ jobs:

notify-slack-on-failure:
if: ${{ always() }} && github.ref == 'refs/heads/master'
needs:
needs:
- validation-complete
runs-on: ubuntu-latest
steps:
Expand All @@ -513,14 +518,15 @@ jobs:

publish:
# Only do this job if publishing a release and validations pass.
needs:
needs:
- validation-complete
- publish-fuel-indexer-binaries
if: github.event_name == 'release' && github.event.action == 'published'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install toolchain
uses: actions-rs/toolchain@v1
with:
Expand All @@ -547,7 +553,7 @@ jobs:
with:
publish-delay: 30000
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}

- name: Notify Slack On Failure
uses: ravsamhq/notify-slack-action@v1
if: always()
Expand Down
2 changes: 1 addition & 1 deletion fuel-indexer-database/database-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
serde = { version = "1.0", default-features = false, features = ["derive"] }
serde = { version = "1.0", default-features = false, features = ["derive", "alloc"] }
strum = { version = "0.24", default-features = false, features = ["derive"] }
2 changes: 1 addition & 1 deletion fuel-indexer-lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
anyhow = { version = "1.0", default-features = false }
anyhow = "1.0"
clap = { version = "3.1", features = ["cargo", "derive", "env"] }
serde = { version = "1.0", features = ["derive"] }
serde_yaml = "0.8"
Expand Down
4 changes: 2 additions & 2 deletions fuel-indexer-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
[dependencies]
chrono = { version = "0.4", features = ["serde"] }
fuel-indexer-lib = { version = "0.1.0", path = "../fuel-indexer-lib" }
fuel-tx = "0.18"
fuel-tx = { version = "0.18", features = ["serde"] }
fuel-types = "0.5"
fuels-core = "0.26"
serde = { version = "1.0", default-features = false, features = ["derive"] }
serde = { version = "1.0", default-features = false, features = ["derive", "alloc"] }

0 comments on commit 0522ce0

Please sign in to comment.