From 0558ddee3b9b2e938458b4696f1ed611af8cb478 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alja=C5=BE=20Mur=20Er=C5=BEen?= Date: Wed, 8 May 2024 13:50:22 +0200 Subject: [PATCH 1/4] Update minimum rust version and build process --- .github/workflows/publish-edgedb-client.yaml | 32 ----- .github/workflows/publish-edgedb-derive.yaml | 25 ++-- .github/workflows/publish-edgedb-errors.yaml | 25 ++-- .../workflows/publish-edgedb-protocol.yaml | 25 ++-- .github/workflows/publish-edgedb-tokio.yaml | 26 +++-- .github/workflows/rust.yml | 53 --------- .github/workflows/test.yml | 24 ++++ .gitignore | 2 - Cargo.toml | 16 +++ edgedb-derive/Cargo.toml | 4 + edgedb-errors/Cargo.toml | 4 + edgedb-protocol/Cargo.toml | 5 +- edgedb-tokio/Cargo.toml | 4 + flake.lock | 109 ++++++++++++++++++ flake.nix | 74 ++++++++++++ justfile | 31 +++++ rust-toolchain.toml | 3 + 17 files changed, 329 insertions(+), 133 deletions(-) delete mode 100644 .github/workflows/publish-edgedb-client.yaml delete mode 100644 .github/workflows/rust.yml create mode 100644 .github/workflows/test.yml create mode 100644 flake.lock create mode 100644 flake.nix create mode 100644 justfile create mode 100644 rust-toolchain.toml diff --git a/.github/workflows/publish-edgedb-client.yaml b/.github/workflows/publish-edgedb-client.yaml deleted file mode 100644 index aef055e4..00000000 --- a/.github/workflows/publish-edgedb-client.yaml +++ /dev/null @@ -1,32 +0,0 @@ -on: - push: - tags: - - releases/edgedb-client/v* - -name: Release edgedb-client - -jobs: - test_and_publish: - name: Test and publish - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@master - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: 1.65 - default: true - - uses: actions-rs/cargo@v1 - with: - command: test - args: --all-features --package=edgedb-client - - run: | - set -x - cargo_version="$(cargo metadata --format-version 1 \ - | jq -r '.packages[] | select(.name=="edgedb-client") | .version')" - tag_version="${GITHUB_REF#refs/tags/releases/edgedb-client/v}" - test "$cargo_version" = "$tag_version" - - - working-directory: ./edgedb-client - run: | - cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/publish-edgedb-derive.yaml b/.github/workflows/publish-edgedb-derive.yaml index 928f6fec..f9ce74b7 100644 --- a/.github/workflows/publish-edgedb-derive.yaml +++ b/.github/workflows/publish-edgedb-derive.yaml @@ -10,16 +10,19 @@ jobs: name: Test and publish runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: 1.65 - default: true - - uses: actions-rs/cargo@v1 - with: - command: test - args: --all-features --package=edgedb-derive + # checkout and env setup + - uses: actions/checkout@v3 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - name: Build the nix shell + run: nix develop --command "just --version" + - uses: Swatinem/rust-cache@v2 + + # test + - name: Test + run: nix develop --command "cargo test --all-features --package=edgedb-derive" + + # verify that git tag matches cargo version - run: | set -x cargo_version="$(cargo metadata --format-version 1 \ @@ -29,4 +32,4 @@ jobs: - working-directory: ./edgedb-derive run: | - cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }} + nix develop --command "cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }}" diff --git a/.github/workflows/publish-edgedb-errors.yaml b/.github/workflows/publish-edgedb-errors.yaml index cc7a646e..37e8f0ed 100644 --- a/.github/workflows/publish-edgedb-errors.yaml +++ b/.github/workflows/publish-edgedb-errors.yaml @@ -10,16 +10,19 @@ jobs: name: Test and publish runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: 1.65 - default: true - - uses: actions-rs/cargo@v1 - with: - command: test - args: --all-features --package=edgedb-errors + # checkout and env setup + - uses: actions/checkout@v3 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - name: Build the nix shell + run: nix develop --command "just --version" + - uses: Swatinem/rust-cache@v2 + + # test + - name: Test + run: nix develop --command "cargo test --all-features --package=edgedb-errors" + + # verify that git tag matches cargo version - run: | set -x cargo_version="$(cargo metadata --format-version 1 \ @@ -29,4 +32,4 @@ jobs: - working-directory: ./edgedb-errors run: | - cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }} + nix develop --command "cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }}" diff --git a/.github/workflows/publish-edgedb-protocol.yaml b/.github/workflows/publish-edgedb-protocol.yaml index 1c5f994c..8ee95ec0 100644 --- a/.github/workflows/publish-edgedb-protocol.yaml +++ b/.github/workflows/publish-edgedb-protocol.yaml @@ -10,16 +10,19 @@ jobs: name: Test and publish runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: 1.65 - default: true - - uses: actions-rs/cargo@v1 - with: - command: test - args: --all-features --package=edgedb-protocol + # checkout and env setup + - uses: actions/checkout@v3 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - name: Build the nix shell + run: nix develop --command "just --version" + - uses: Swatinem/rust-cache@v2 + + # test + - name: Test + run: nix develop --command "cargo test --all-features --package=edgedb-protocol" + + # verify that git tag matches cargo version - run: | set -x cargo_version="$(cargo metadata --format-version 1 \ @@ -29,4 +32,4 @@ jobs: - working-directory: ./edgedb-protocol run: | - cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }} + nix develop --command "cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }}" diff --git a/.github/workflows/publish-edgedb-tokio.yaml b/.github/workflows/publish-edgedb-tokio.yaml index ee938f9c..d6dbeee1 100644 --- a/.github/workflows/publish-edgedb-tokio.yaml +++ b/.github/workflows/publish-edgedb-tokio.yaml @@ -10,17 +10,19 @@ jobs: name: Test and publish runs-on: ubuntu-latest steps: - - uses: actions/checkout@master - - uses: edgedb/setup-edgedb@v1.2.2 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: 1.65 - default: true - - uses: actions-rs/cargo@v1 - with: - command: test - args: --all-features --package=edgedb-tokio + # checkout and env setup + - uses: actions/checkout@v3 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - name: Build the nix shell + run: nix develop --command "just --version" + - uses: Swatinem/rust-cache@v2 + + # test + - name: Test + run: nix develop --command "cargo test --all-features --package=edgedb-tokio" + + # verify that git tag matches cargo version - run: | set -x cargo_version="$(cargo metadata --format-version 1 \ @@ -30,4 +32,4 @@ jobs: - working-directory: ./edgedb-tokio run: | - cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }} + nix develop --command "cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }}" diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml deleted file mode 100644 index b6dcb109..00000000 --- a/.github/workflows/rust.yml +++ /dev/null @@ -1,53 +0,0 @@ -on: [pull_request] - -name: CI - -jobs: - build_and_test: - name: Tests - runs-on: ubuntu-latest - strategy: - matrix: - rust_version: ["1.72", stable, beta] - timeout-minutes: 15 - steps: - - uses: actions/checkout@master - - uses: edgedb/setup-edgedb@v1 - - uses: dtolnay/rust-toolchain@be73d7920c329f220ce78e0234b8f96b7ae60248 - with: - components: "cargo,rustc,rust-std,clippy,rustfmt" - toolchain: ${{ matrix.rust_version }} - - name: Test all features - run: | - cargo test --workspace --all-features - - name: Check no default features - run: | - cargo check --no-default-features --workspace - - name: Check with `fs` feature (edgedb-tokio) - run: | - cargo check --features=fs --package edgedb-tokio - - name: Check with env feature, edgedb-tokio - run: | - cargo check --features=env --package edgedb-tokio - - name: Test edgedb-protocol without default features - run: | - cargo test --package=edgedb-protocol --no-default-features - - name: Test edgedb-protocol with "all-types" feature - run: | - cargo test --package=edgedb-protocol --features=all-types - - - run: | - cargo clippy --all-features --workspace --all-targets -- \ - -A clippy::collapsible_if \ - -A clippy::derive_partial_eq_without_eq \ - -A clippy::zero_ptr \ - -A clippy::manual_strip \ - -A clippy::new_ret_no_self \ - -A clippy::type_complexity \ - -A clippy::vec_init_then_push \ - -A clippy::while_let_on_iterator \ - -A clippy::useless_format \ - -A clippy::too_many_arguments \ - -A clippy::clone_on_copy - - run: | - cargo fmt --check diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..15e6aee9 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,24 @@ +on: [pull_request] + +name: CI + +jobs: + build_and_test: + name: Tests + runs-on: ubuntu-latest + strategy: + matrix: + rust_version: [default, minimum, beta] + timeout-minutes: 15 + steps: + # checkout and env setup + - uses: actions/checkout@v3 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - name: Build the nix shell + run: nix develop .#${{ matrix.rust_version }} --command "just --version" + - uses: Swatinem/rust-cache@v2 + + # run tests + - name: Run tests + run: nix develop .#${{ matrix.rust_version }} --command "just test" diff --git a/.gitignore b/.gitignore index 6b4fb3fc..d9babeaa 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,5 @@ __pycache__ /.vscode # nix stuff -/flake.nix -/flake.lock /.envrc /.direnv diff --git a/Cargo.toml b/Cargo.toml index 6cb76465..f5cd66b3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,3 +12,19 @@ members = [ [profile.release] debug = true lto = true + +[workspace.package] +rust-version = "1.72" # keep in sync with flake.nix + +[workspace.lints.clippy] +useless_format = 'allow' +collapsible_if = 'allow' +derive_partial_eq_without_eq = 'allow' +zero_ptr = 'allow' +manual_strip = 'allow' +new_ret_no_self = 'allow' +type_complexity = 'allow' +vec_init_then_push = 'allow' +while_let_on_iterator = 'allow' +too_many_arguments = 'allow' +clone_on_copy = 'allow' diff --git a/edgedb-derive/Cargo.toml b/edgedb-derive/Cargo.toml index 713fd219..790f46ca 100644 --- a/edgedb-derive/Cargo.toml +++ b/edgedb-derive/Cargo.toml @@ -8,6 +8,7 @@ description = """ Derive macros for EdgeDB database client. """ readme = "README.md" +rust-version.workspace = true [dependencies] syn = {version="2.0", features=["full"]} @@ -23,3 +24,6 @@ serde_json = "1.0" [lib] proc-macro = true + +[lints] +workspace = true diff --git a/edgedb-errors/Cargo.toml b/edgedb-errors/Cargo.toml index c25f047f..0ecb213d 100644 --- a/edgedb-errors/Cargo.toml +++ b/edgedb-errors/Cargo.toml @@ -8,9 +8,13 @@ description = """ Error types for EdgeDB database client. """ readme = "README.md" +rust-version.workspace = true [dependencies] bytes = "1.0.1" miette = { version = "7.2.0", optional = true } [lib] + +[lints] +workspace = true diff --git a/edgedb-protocol/Cargo.toml b/edgedb-protocol/Cargo.toml index 24a9ee6a..f4fad7c4 100644 --- a/edgedb-protocol/Cargo.toml +++ b/edgedb-protocol/Cargo.toml @@ -9,7 +9,7 @@ description = """ Use edgedb-tokio for applications instead. """ readme = "README.md" -rust-version = "1.65" +rust-version.workspace = true [dependencies] bytes = "1.5.0" @@ -38,3 +38,6 @@ test-case = "3.0.0" humantime = "2.1.0" [lib] + +[lints] +workspace = true diff --git a/edgedb-tokio/Cargo.toml b/edgedb-tokio/Cargo.toml index bc9a8dfe..ef2f28c0 100644 --- a/edgedb-tokio/Cargo.toml +++ b/edgedb-tokio/Cargo.toml @@ -8,6 +8,7 @@ description = """ EdgeDB database client implementation for tokio. """ readme = "README.md" +rust-version.workspace = true [dependencies] edgedb-protocol = { path = "../edgedb-protocol", version = "0.6.0" } @@ -72,3 +73,6 @@ admin_socket = ["dirs"] unstable = ["serde_json", "tokio-stream"] # features for CLI and Wasm fs = ["tokio/fs", "dirs", "serde_json"] miette-errors = ["edgedb-errors/miette"] + +[lints] +workspace = true diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..d650b0ef --- /dev/null +++ b/flake.lock @@ -0,0 +1,109 @@ +{ + "nodes": { + "edgedb": { + "inputs": { + "flake-parts": [ + "flake-parts" + ], + "nixpkgs": [ + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1709819111, + "narHash": "sha256-8yHlJLdyvSrDg2dVpL7c55CGjPlGenTvXsogk2Gnl+w=", + "owner": "edgedb", + "repo": "packages-nix", + "rev": "2dac891f0cf38b7ee00749243c5908389cdf24d9", + "type": "github" + }, + "original": { + "owner": "edgedb", + "repo": "packages-nix", + "type": "github" + } + }, + "fenix": { + "inputs": { + "nixpkgs": [ + "nixpkgs" + ], + "rust-analyzer-src": [] + }, + "locked": { + "lastModified": 1708928609, + "narHash": "sha256-LcXC2NP/TzHMmJThZGG1e+7rht5HeuZK5WOirIDg+lU=", + "owner": "nix-community", + "repo": "fenix", + "rev": "e928fb6b5179ebd032c19afac5c461ccc0b6de55", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "fenix", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1706830856, + "narHash": "sha256-a0NYyp+h9hlb7ddVz4LUn1vT/PLwqfrWYcHMvFB1xYg=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "b253292d9c0a5ead9bc98c4e9a26c6312e27d69f", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1709816690, + "narHash": "sha256-ugzGLZd+LPVigd8psiEpHokxsA6a3kXkVvkpH125FmM=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "00f00e0663ee05d58b8f9bdc937018409d49d48a", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "dir": "lib", + "lastModified": 1706550542, + "narHash": "sha256-UcsnCG6wx++23yeER4Hg18CXWbgNpqNXcHIo5/1Y+hc=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "97b17f32362e475016f942bbdfda4a4a72a8a652", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "edgedb": "edgedb", + "fenix": "fenix", + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..fd613793 --- /dev/null +++ b/flake.nix @@ -0,0 +1,74 @@ +{ + description = "The EdgeDB CLI"; + inputs = { + nixpkgs.url = "github:nixos/nixpkgs"; + flake-parts.url = "github:hercules-ci/flake-parts"; + + # provides rust toolchain + fenix = { + url = "github:nix-community/fenix"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.rust-analyzer-src.follows = ""; + }; + + edgedb = { + url = "github:edgedb/packages-nix"; + inputs.nixpkgs.follows = "nixpkgs"; + inputs.flake-parts.follows = "flake-parts"; + }; + }; + + outputs = inputs@{ flake-parts, fenix, edgedb, ... }: + flake-parts.lib.mkFlake {inherit inputs;} { + systems = ["x86_64-linux" "x86_64-darwin" "aarch64-darwin"]; + perSystem = { config, system, pkgs, ... }: + let + fenix_pkgs = fenix.packages.${system}; + + common = [ + pkgs.just + + # needed for tests + edgedb.packages.${system}.edgedb-server + + # TODO: also install edgedb-cli, needed for tests + ] + ++ pkgs.lib.optional pkgs.stdenv.isDarwin [ + pkgs.libiconv + pkgs.darwin.apple_sdk.frameworks.CoreServices + pkgs.darwin.apple_sdk.frameworks.SystemConfiguration + ]; + in { + + # toolchain defined in rust-toolchain.toml + devShells.default = pkgs.mkShell { + buildInputs = [ + (fenix_pkgs.fromToolchainFile { + file = ./rust-toolchain.toml; + sha256 = "sha256-opUgs6ckUQCyDxcB9Wy51pqhd0MPGHUVbwRKKPGiwZU="; + }) + ] ++ common; + }; + + # minimum supported rust version of this crate + devShells.minimum = pkgs.mkShell { + buildInputs = [ + (fenix_pkgs.toolchainOf { + channel = "1.72"; # keep in sync with ./Cargo.toml rust-version + sha256 = "sha256-dxE7lmCFWlq0nl/wKcmYvpP9zqQbBitAQgZ1zx9Ooik="; + }).defaultToolchain + ] ++ common; + }; + + # rust beta version + devShells.beta = pkgs.mkShell { + buildInputs = [ + (fenix_pkgs.toolchainOf { + channel = "beta"; + sha256 = "sha256-H1BZtppFoMkxdDQ6ZVbTSg9PoKzkvsEbSSPIoB55t1w="; + }).defaultToolchain + ] ++ common; + }; + }; + }; +} diff --git a/justfile b/justfile new file mode 100644 index 00000000..657427db --- /dev/null +++ b/justfile @@ -0,0 +1,31 @@ + +test: + # Test all features + cargo test --workspace --all-features + + # Check no default features + cargo check --no-default-features --workspace + + # Check `fs` feature (edgedb-tokio) + cargo check --features=fs --package edgedb-tokio + + # Check with env feature, edgedb-tokio + cargo check --features=env --package edgedb-tokio + + # Test edgedb-protocol without default features + cargo test --package=edgedb-protocol --no-default-features + + # Test edgedb-protocol with "all-types" feature + cargo test --package=edgedb-protocol --features=all-types + + cargo clippy --workspace --all-features --all-targets + + cargo fmt --check + + +test-fast: + cargo fmt + + cargo test --workspace --features=unstable + + cargo clippy --workspace --all-features --all-targets \ No newline at end of file diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 00000000..d217385a --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,3 @@ +[toolchain] +channel = "1.78" +components = ["rustc", "cargo", "rust-std", "rust-src", "clippy", "rustfmt", "rust-analyzer"] From 61f104f584c464eb729534f2c757421e05e720d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alja=C5=BE=20Mur=20Er=C5=BEen?= Date: Wed, 8 May 2024 13:57:33 +0200 Subject: [PATCH 2/4] fix --- .github/workflows/publish-edgedb-derive.yaml | 6 +++--- .github/workflows/publish-edgedb-errors.yaml | 6 +++--- .github/workflows/publish-edgedb-protocol.yaml | 6 +++--- .github/workflows/publish-edgedb-tokio.yaml | 6 +++--- .github/workflows/test.yml | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/publish-edgedb-derive.yaml b/.github/workflows/publish-edgedb-derive.yaml index f9ce74b7..933e948c 100644 --- a/.github/workflows/publish-edgedb-derive.yaml +++ b/.github/workflows/publish-edgedb-derive.yaml @@ -15,12 +15,12 @@ jobs: - uses: DeterminateSystems/nix-installer-action@main - uses: DeterminateSystems/magic-nix-cache-action@main - name: Build the nix shell - run: nix develop --command "just --version" + run: nix develop --command just --version - uses: Swatinem/rust-cache@v2 # test - name: Test - run: nix develop --command "cargo test --all-features --package=edgedb-derive" + run: nix develop --command cargo test --all-features --package=edgedb-derive # verify that git tag matches cargo version - run: | @@ -32,4 +32,4 @@ jobs: - working-directory: ./edgedb-derive run: | - nix develop --command "cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }}" + nix develop --command cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/publish-edgedb-errors.yaml b/.github/workflows/publish-edgedb-errors.yaml index 37e8f0ed..3b798e7e 100644 --- a/.github/workflows/publish-edgedb-errors.yaml +++ b/.github/workflows/publish-edgedb-errors.yaml @@ -15,12 +15,12 @@ jobs: - uses: DeterminateSystems/nix-installer-action@main - uses: DeterminateSystems/magic-nix-cache-action@main - name: Build the nix shell - run: nix develop --command "just --version" + run: nix develop --command just --version - uses: Swatinem/rust-cache@v2 # test - name: Test - run: nix develop --command "cargo test --all-features --package=edgedb-errors" + run: nix develop --command cargo test --all-features --package=edgedb-errors # verify that git tag matches cargo version - run: | @@ -32,4 +32,4 @@ jobs: - working-directory: ./edgedb-errors run: | - nix develop --command "cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }}" + nix develop --command cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/publish-edgedb-protocol.yaml b/.github/workflows/publish-edgedb-protocol.yaml index 8ee95ec0..a50c0025 100644 --- a/.github/workflows/publish-edgedb-protocol.yaml +++ b/.github/workflows/publish-edgedb-protocol.yaml @@ -15,12 +15,12 @@ jobs: - uses: DeterminateSystems/nix-installer-action@main - uses: DeterminateSystems/magic-nix-cache-action@main - name: Build the nix shell - run: nix develop --command "just --version" + run: nix develop --command just --version - uses: Swatinem/rust-cache@v2 # test - name: Test - run: nix develop --command "cargo test --all-features --package=edgedb-protocol" + run: nix develop --command cargo test --all-features --package=edgedb-protocol # verify that git tag matches cargo version - run: | @@ -32,4 +32,4 @@ jobs: - working-directory: ./edgedb-protocol run: | - nix develop --command "cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }}" + nix develop --command cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/publish-edgedb-tokio.yaml b/.github/workflows/publish-edgedb-tokio.yaml index d6dbeee1..74a695b0 100644 --- a/.github/workflows/publish-edgedb-tokio.yaml +++ b/.github/workflows/publish-edgedb-tokio.yaml @@ -15,12 +15,12 @@ jobs: - uses: DeterminateSystems/nix-installer-action@main - uses: DeterminateSystems/magic-nix-cache-action@main - name: Build the nix shell - run: nix develop --command "just --version" + run: nix develop --command just --version - uses: Swatinem/rust-cache@v2 # test - name: Test - run: nix develop --command "cargo test --all-features --package=edgedb-tokio" + run: nix develop --command cargo test --all-features --package=edgedb-tokio # verify that git tag matches cargo version - run: | @@ -32,4 +32,4 @@ jobs: - working-directory: ./edgedb-tokio run: | - nix develop --command "cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }}" + nix develop --command cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 15e6aee9..156c0f24 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,9 +16,9 @@ jobs: - uses: DeterminateSystems/nix-installer-action@main - uses: DeterminateSystems/magic-nix-cache-action@main - name: Build the nix shell - run: nix develop .#${{ matrix.rust_version }} --command "just --version" + run: nix develop .#${{ matrix.rust_version }} --command just --version - uses: Swatinem/rust-cache@v2 # run tests - name: Run tests - run: nix develop .#${{ matrix.rust_version }} --command "just test" + run: nix develop .#${{ matrix.rust_version }} --command just test From 3845686b6417523d73894f7cc3e78be214716c05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alja=C5=BE=20Mur=20Er=C5=BEen?= Date: Wed, 8 May 2024 18:43:48 +0200 Subject: [PATCH 3/4] fix --- flake.lock | 67 +++++++++++++++++++++++++++++++++++------------------- flake.nix | 4 ++-- 2 files changed, 45 insertions(+), 26 deletions(-) diff --git a/flake.lock b/flake.lock index d650b0ef..d3dd1409 100644 --- a/flake.lock +++ b/flake.lock @@ -1,7 +1,32 @@ { "nodes": { + "crane": { + "inputs": { + "nixpkgs": [ + "edgedb", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1714864355, + "narHash": "sha256-uXNW6bapWFfkYIkK1EagydSrFMqycOYEDSq75GmUpjk=", + "owner": "ipetkov", + "repo": "crane", + "rev": "442a7a6152f49b907e73206dc8e1f46a61e8e873", + "type": "github" + }, + "original": { + "owner": "ipetkov", + "repo": "crane", + "type": "github" + } + }, "edgedb": { "inputs": { + "crane": "crane", + "fenix": [ + "fenix" + ], "flake-parts": [ "flake-parts" ], @@ -10,11 +35,11 @@ ] }, "locked": { - "lastModified": 1709819111, - "narHash": "sha256-8yHlJLdyvSrDg2dVpL7c55CGjPlGenTvXsogk2Gnl+w=", + "lastModified": 1715179013, + "narHash": "sha256-Gx/2vkhWGiYgzmfuC14G9wzmjTjI5w89ArOxPGRXqxA=", "owner": "edgedb", "repo": "packages-nix", - "rev": "2dac891f0cf38b7ee00749243c5908389cdf24d9", + "rev": "8f79363dca2bf29907d9e3439d700e2ae008d9d8", "type": "github" }, "original": { @@ -31,11 +56,11 @@ "rust-analyzer-src": [] }, "locked": { - "lastModified": 1708928609, - "narHash": "sha256-LcXC2NP/TzHMmJThZGG1e+7rht5HeuZK5WOirIDg+lU=", + "lastModified": 1715063087, + "narHash": "sha256-cktPkcCmJ2sR0V/FaWEuCWmKuGPbwoMltih/EfF0mXg=", "owner": "nix-community", "repo": "fenix", - "rev": "e928fb6b5179ebd032c19afac5c461ccc0b6de55", + "rev": "f8f16c1f2c83bea4e51e6522d988ec8bfcc8420e", "type": "github" }, "original": { @@ -49,11 +74,11 @@ "nixpkgs-lib": "nixpkgs-lib" }, "locked": { - "lastModified": 1706830856, - "narHash": "sha256-a0NYyp+h9hlb7ddVz4LUn1vT/PLwqfrWYcHMvFB1xYg=", + "lastModified": 1714641030, + "narHash": "sha256-yzcRNDoyVP7+SCNX0wmuDju1NUCt8Dz9+lyUXEI0dbI=", "owner": "hercules-ci", "repo": "flake-parts", - "rev": "b253292d9c0a5ead9bc98c4e9a26c6312e27d69f", + "rev": "e5d10a24b66c3ea8f150e47dfdb0416ab7c3390e", "type": "github" }, "original": { @@ -64,11 +89,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1709816690, - "narHash": "sha256-ugzGLZd+LPVigd8psiEpHokxsA6a3kXkVvkpH125FmM=", + "lastModified": 1715184436, + "narHash": "sha256-GySDOHwaApTZWH9NId9cy3Dq+1mVzMOaE8qWMVwP+J4=", "owner": "nixos", "repo": "nixpkgs", - "rev": "00f00e0663ee05d58b8f9bdc937018409d49d48a", + "rev": "4f554f0ff09c4cd34ca201c759c29008d1010eac", "type": "github" }, "original": { @@ -79,20 +104,14 @@ }, "nixpkgs-lib": { "locked": { - "dir": "lib", - "lastModified": 1706550542, - "narHash": "sha256-UcsnCG6wx++23yeER4Hg18CXWbgNpqNXcHIo5/1Y+hc=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "97b17f32362e475016f942bbdfda4a4a72a8a652", - "type": "github" + "lastModified": 1714640452, + "narHash": "sha256-QBx10+k6JWz6u7VsohfSw8g8hjdBZEf8CFzXH1/1Z94=", + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz" }, "original": { - "dir": "lib", - "owner": "NixOS", - "ref": "nixos-unstable", - "repo": "nixpkgs", - "type": "github" + "type": "tarball", + "url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz" } }, "root": { diff --git a/flake.nix b/flake.nix index fd613793..a8adc065 100644 --- a/flake.nix +++ b/flake.nix @@ -15,6 +15,7 @@ url = "github:edgedb/packages-nix"; inputs.nixpkgs.follows = "nixpkgs"; inputs.flake-parts.follows = "flake-parts"; + inputs.fenix.follows = "fenix"; }; }; @@ -30,8 +31,7 @@ # needed for tests edgedb.packages.${system}.edgedb-server - - # TODO: also install edgedb-cli, needed for tests + edgedb.packages.${system}.edgedb-cli ] ++ pkgs.lib.optional pkgs.stdenv.isDarwin [ pkgs.libiconv From 2ddbd41bebb0adf5090af2098ba42665ccfc422f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alja=C5=BE=20Mur=20Er=C5=BEen?= Date: Wed, 8 May 2024 19:14:47 +0200 Subject: [PATCH 4/4] fix --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 156c0f24..8903c842 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: rust_version: [default, minimum, beta] - timeout-minutes: 15 + timeout-minutes: 30 steps: # checkout and env setup - uses: actions/checkout@v3