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

ci: use buildjet runners #653

Merged
merged 1 commit into from
Mar 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 27 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ env:
CARGO_TERM_COLOR: always
RUSTFLAGS: -D warnings
REGISTRY: ghcr.io
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 2
SQLX_OFFLINE: true
RUSTC_VERSION: 1.67
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
Expand All @@ -23,7 +24,7 @@ env:

jobs:
cancel-previous-runs:
runs-on: ubuntu-latest
runs-on: buildjet-4vcpu-ubuntu-2204
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
Expand All @@ -33,7 +34,7 @@ jobs:
check-rustc:
needs:
- cancel-previous-runs
runs-on: ubuntu-latest
runs-on: buildjet-4vcpu-ubuntu-2204
steps:
- name: Check rustc version
run: |
Expand All @@ -48,25 +49,23 @@ jobs:
cargo-toml-fmt-check:
needs:
- check-rustc
runs-on: ubuntu-latest
runs-on: buildjet-4vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- uses: Swatinem/rust-cache@v1
toolchain: ${{ env.RUSTC_VERSION }}
- name: setup binstall
uses: taiki-e/install-action@cargo-binstall
- name: Install Cargo.toml linter
uses: baptiste0928/cargo-install@v1
with:
crate: cargo-toml-lint
version: '0.1'
- name: Run Cargo.toml linter
run: git ls-files | grep Cargo.toml$ | xargs --verbose -n 1 cargo-toml-lint
run: cargo binstall --no-confirm cargo-sort
- name: Run Cargo.toml sort check
run: cargo sort -w --check packages/**/Cargo.toml

set-env-vars:
needs:
- check-rustc
runs-on: ubuntu-latest
runs-on: buildjet-4vcpu-ubuntu-2204
outputs:
IS_MASTER: ${{ steps.set-env.outputs.IS_MASTER }}
IS_RELEASE: ${{ steps.set-env.outputs.IS_RELEASE }}
Expand All @@ -84,7 +83,7 @@ jobs:
if: needs.set-env-vars.outputs.IS_RELEASE_OR_MASTER != 'true'
needs:
- set-env-vars
runs-on: ubuntu-latest
runs-on: buildjet-4vcpu-ubuntu-2204
outputs:
is_semver_branch: ${{ steps.semver-branch-check.outputs.is_semver_branch }}
steps:
Expand All @@ -100,7 +99,7 @@ jobs:
mdbook-lint:
needs:
- check-rustc
runs-on: ubuntu-latest
runs-on: buildjet-4vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand All @@ -113,7 +112,7 @@ jobs:
mdbook-build:
needs:
- mdbook-lint
runs-on: ubuntu-latest
runs-on: buildjet-4vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
Expand All @@ -127,7 +126,7 @@ jobs:
mdbook-version: 'latest'

cargo-verifications:
runs-on: ubuntu-latest
runs-on: buildjet-4vcpu-ubuntu-2204
services:
postgres:
image: postgres:latest
Expand Down Expand Up @@ -180,7 +179,7 @@ jobs:
needs:
- cargo-toml-fmt-check
- set-env-vars
runs-on: ubuntu-latest
runs-on: buildjet-4vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
Expand All @@ -195,7 +194,7 @@ jobs:
needs:
- cargo-toml-fmt-check
- set-env-vars
runs-on: ubuntu-latest
runs-on: buildjet-4vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
Expand All @@ -210,7 +209,7 @@ jobs:
needs:
- cargo-toml-fmt-check
- set-env-vars
runs-on: ubuntu-latest
runs-on: buildjet-4vcpu-ubuntu-2204
services:
postgres:
image: postgres:latest
Expand All @@ -235,7 +234,7 @@ jobs:
needs:
- cargo-toml-fmt-check
- set-env-vars
runs-on: ubuntu-latest
runs-on: buildjet-4vcpu-ubuntu-2204
services:
postgres:
image: postgres:latest
Expand Down Expand Up @@ -280,7 +279,7 @@ jobs:
needs:
- cargo-toml-fmt-check
- set-env-vars
runs-on: ubuntu-latest
runs-on: buildjet-4vcpu-ubuntu-2204
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
Expand Down Expand Up @@ -318,7 +317,7 @@ jobs:
- check-forc-index
- set-env-vars
if: needs.set-env-vars.outputs.IS_RELEASE_OR_MASTER == 'true'
runs-on: ubuntu-latest
runs-on: buildjet-4vcpu-ubuntu-2204
permissions:
contents: read
packages: write
Expand Down Expand Up @@ -570,7 +569,7 @@ jobs:
needs:
- publish-docker-image
- set-env-vars
runs-on: ubuntu-latest
runs-on: buildjet-4vcpu-ubuntu-2204
steps:
- name: Set Environment Variables
run: |
Expand Down Expand Up @@ -599,7 +598,7 @@ jobs:
- publish-docker-image
- set-env-vars
if: needs.set-env-vars.outputs.IS_RELEASE == 'true'
runs-on: ubuntu-latest
runs-on: buildjet-4vcpu-ubuntu-2204
steps:
- name: Checkout repository
uses: actions/checkout@v2
Expand Down Expand Up @@ -657,15 +656,15 @@ jobs:
- deploy
- publish
- cargo-verifications
runs-on: ubuntu-latest
runs-on: buildjet-4vcpu-ubuntu-2204
steps:
- run: true

notify-slack-on-failure:
needs:
- validation-complete
if: always()
runs-on: ubuntu-latest
runs-on: buildjet-4vcpu-ubuntu-2204
steps:
- name: Notify Slack On Failure
uses: ravsamhq/notify-slack-action@v2
Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ members = [
"examples/hello-world/hello-index",
"examples/hello-world/hello-world-data",
"examples/hello-world/hello-world-node",
"packages/fuel-indexer",
"packages/fuel-indexer-api-server",
"packages/fuel-indexer-database",
"packages/fuel-indexer-database/database-types",
Expand All @@ -22,7 +23,6 @@ members = [
"packages/fuel-indexer-tests/components/indices/simple-wasm/simple-wasm",
"packages/fuel-indexer-tests/components/web-api",
"packages/fuel-indexer-types",
"packages/fuel-indexer",
"plugins/forc-index",
"plugins/forc-postgres",
]
Expand Down Expand Up @@ -54,4 +54,4 @@ fuel-indexer-metrics = { version = "0.4.0", path = "./packages/fuel-indexer-metr
fuel-indexer-plugin = { version = "0.4.0", path = "./packages/fuel-indexer-plugin", default-features = false }
fuel-indexer-postgres = { version = "0.4.0", path = "./packages/fuel-indexer-database/postgres", default-features = false }
fuel-indexer-schema = { version = "0.4.0", path = "./packages/fuel-indexer-schema", default-features = false }
fuel-indexer-types = { version = "0.4.0", path = "./packages/fuel-indexer-types" }
fuel-indexer-types = { version = "0.4.0", path = "./packages/fuel-indexer-types" }
2 changes: 1 addition & 1 deletion examples/block-explorer/explorer-index/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fuel-indexer-plugin = { workspace = true }
fuel-indexer-schema = { workspace = true, default-features = false }
fuel-tx = "0.26"
fuels-core = { version = "0.37", default-features = false }
fuels-macros = { version = "0.37"}
fuels-macros = { version = "0.37" }
fuels-types = { version = "0.37", default-features = false }
getrandom = { version = "0.2", features = ["js"] }
serde = { version = "1.0", default-features = false, features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion examples/hello-world-native/hello-index-native/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ fuel-tx = "0.26.0"
fuels = { version = "0.37" }
fuels-core = { version = "0.37", default-features = false }
fuels-macros = { version = "0.37" }
fuels-types = { version = "0.37" , default-features = false }
fuels-types = { version = "0.37", default-features = false }
getrandom = { version = "0.2", features = ["js"] }
instant = { version = "0.1", default-features = false }
serde = { version = "1.0", default-features = false, features = ["derive"] }
4 changes: 2 additions & 2 deletions examples/hello-world/hello-index/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ fuel-indexer-plugin = { workspace = true }
fuel-indexer-schema = { workspace = true, default-features = false }
fuel-tx = "0.26.0"
fuels-core = { version = "0.37", default-features = false }
fuels-macros = { version = "0.37"}
fuels-types = { version = "0.37" , default-features = false }
fuels-macros = { version = "0.37" }
fuels-types = { version = "0.37", default-features = false }
getrandom = { version = "0.2", features = ["js"] }
instant = { version = "0.1", default-features = false }
serde = { version = "1.0", default-features = false, features = ["derive"] }
2 changes: 1 addition & 1 deletion packages/fuel-indexer-api-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ fuel-indexer-lib = { workspace = true }
fuel-indexer-metrics = { workspace = true, optional = true }
fuel-indexer-schema = { workspace = true, features = ["db-models"] }
http = "0.2"
hyper = { version = "0.14", features = ["client", "http2", "http1", "runtime" ]}
hyper = { version = "0.14", features = ["client", "http2", "http1", "runtime" ] }
hyper-rustls = { version = "0.23", features = ["http2"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0", features = ["raw_value"] }
Expand Down
5 changes: 1 addition & 4 deletions packages/fuel-indexer-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ repository = { workspace = true }
rust-version = { workspace = true }
description = "Fuel Indexer Macros"

[package.metadata.cargo-udeps.ignore]
development = ["fuels", "fuel-indexer-plugin"]

[lib]
proc-macro = true

Expand All @@ -37,7 +34,7 @@ syn = { version = "1.0", features = ["full"] }

[dev-dependencies]
fuel-indexer-plugin = { workspace = true }
fuels = { version = "0.37"}
fuels = { version = "0.37" }
fuels-macros = { version = "0.37", default-features = false }
fuels-types = { version = "0.37", default-features = false }
trybuild = "1.0"
Expand Down
3 changes: 1 addition & 2 deletions packages/fuel-indexer-metrics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@ license = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
description = "Fuel Indexer Metrics"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
lazy_static = "1.4"
prometheus = "0.13"
thiserror = "1.0"
thiserror = "1.0"
4 changes: 1 addition & 3 deletions packages/fuel-indexer-tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@


[package]
name = "fuel-indexer-tests"
version = "0.0.0"
Expand Down Expand Up @@ -42,7 +40,7 @@ fuels-core = { version = "0.37", default-features = true }
fuels-macros = { version = "0.37" }
futures = "0.3"
hex = "0.4"
hyper = { version = "0.14", features = ["client", "http2", "http1", "runtime" ]}
hyper = { version = "0.14", features = ["client", "http2", "http1", "runtime" ] }
itertools = "0.10"
lazy_static = "1.4"
rand = "0.8"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ fuel-indexer-tests = { version = "0.0.0", path = "./../../../fuel-indexer-tests"
fuel-types = "0.26.0"
fuels = { version = "0.37", features = ["fuel-core-lib"] }
fuels-macros = { version = "0.37" }
tokio = { version = "1.17", features = ["macros", "rt-multi-thread"] }
tokio = { version = "1.17", features = ["macros", "rt-multi-thread"] }
1 change: 0 additions & 1 deletion plugins/forc-postgres/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ license = { workspace = true }
repository = { workspace = true }
rust-version = { workspace = true }
description = "Fuel Indexer forc Postgres plugin"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[[bin]]
Expand Down
19 changes: 19 additions & 0 deletions tomlfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# trailing comma in arrays
always_trailing_comma = false
# trailing comma when multi-line
multiline_trailing_comma = true
space_around_eq = true
# remove all the spacing inside the array
compact_arrays = false
# remove all the spacing inside the object
compact_inline_tables = false
trailing_newline = true
# is it ok to have blank lines inside of a table
# this option needs to be true for the --grouped flag
key_value_newlines = true
allowed_blank_lines = 1
# windows style line endings
crlf = false
# The user specified ordering of tables in a document.
# All unspecified tables will come after these.
table_order = []