From 11bdcd19f383c7a49bbd0c08812a91d17b7deba8 Mon Sep 17 00:00:00 2001 From: mikeee Date: Mon, 19 Aug 2024 13:28:59 +0100 Subject: [PATCH 1/8] ci: disable caching and conditionally set up go Signed-off-by: mikeee --- .github/workflows/validate-examples.yml | 32 +++++++++++++++++++++---- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/.github/workflows/validate-examples.yml b/.github/workflows/validate-examples.yml index 4af707a..3662f68 100644 --- a/.github/workflows/validate-examples.yml +++ b/.github/workflows/validate-examples.yml @@ -71,11 +71,6 @@ jobs: repository: ${{ env.CHECKOUT_REPO }} ref: ${{ env.CHECKOUT_REF }} - - name: Set up Go - uses: actions/setup-go@v5 - with: - go-version: "stable" - - name: Determine latest Dapr Runtime version if: env.DAPR_RUNTIME_VERSION == '' run: | @@ -106,6 +101,33 @@ jobs: ref: ${{ env.DAPR_REF }} path: dapr_runtime + - name: Set up Go + uses: actions/setup-go@v5 + if: env.DAPR_REF != '' || env.DAPR_CLI_REF != '' + with: + cache: false + go-version: "stable" + + - name: Install Dapr CLI + if: env.DAPR_CLI_REF != '' + run: | + cd cli + sh ${{ env.DAPR_INSTALL_URL }} -v ${{ env.DAPR_CLI_VERSION }} -n + + - name: Install Dapr Runtime + if: env.DAPR_REF != '' + run: | + cd dapr_runtime + make install + + - name: Build dapr cli with latest stable version + if: env.DAPR_CLI_REF == '' + run: | + cd cli + make + with: + go-version: "stable" + - name: Build dapr cli with referenced commit and override version if: env.DAPR_CLI_REF != '' run: | From 5b8dbde410d0ff143c167b40aa4b896bb05f60e5 Mon Sep 17 00:00:00 2001 From: mikeee Date: Mon, 19 Aug 2024 13:32:46 +0100 Subject: [PATCH 2/8] ci: update actions/checkout to v4 and locks fossa to v1 Signed-off-by: mikeee --- .github/workflows/fossa.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/fossa.yml b/.github/workflows/fossa.yml index dadfc55..7042de6 100644 --- a/.github/workflows/fossa.yml +++ b/.github/workflows/fossa.yml @@ -32,15 +32,15 @@ jobs: FOSSA_API_KEY: b88e1f4287c3108c8751bf106fb46db6 # This is a push-only token that is safe to be exposed. steps: - name: "Checkout code" - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: "Run FOSSA Scan" - uses: fossas/fossa-action@main # Use a specific version if locking is preferred + uses: fossas/fossa-action@v1 # Use a specific version if locking is preferred with: api-key: ${{ env.FOSSA_API_KEY }} - name: "Run FOSSA Test" - uses: fossas/fossa-action@main # Use a specific version if locking is preferred + uses: fossas/fossa-action@v1 # Use a specific version if locking is preferred with: api-key: ${{ env.FOSSA_API_KEY }} run-tests: true From ad538475438eb2341224f411865eba4cf277ed37 Mon Sep 17 00:00:00 2001 From: mikeee Date: Mon, 19 Aug 2024 13:42:56 +0100 Subject: [PATCH 3/8] ci: fix typo Signed-off-by: mikeee --- .github/workflows/validate-examples.yml | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/.github/workflows/validate-examples.yml b/.github/workflows/validate-examples.yml index 3662f68..e79692c 100644 --- a/.github/workflows/validate-examples.yml +++ b/.github/workflows/validate-examples.yml @@ -108,26 +108,6 @@ jobs: cache: false go-version: "stable" - - name: Install Dapr CLI - if: env.DAPR_CLI_REF != '' - run: | - cd cli - sh ${{ env.DAPR_INSTALL_URL }} -v ${{ env.DAPR_CLI_VERSION }} -n - - - name: Install Dapr Runtime - if: env.DAPR_REF != '' - run: | - cd dapr_runtime - make install - - - name: Build dapr cli with latest stable version - if: env.DAPR_CLI_REF == '' - run: | - cd cli - make - with: - go-version: "stable" - - name: Build dapr cli with referenced commit and override version if: env.DAPR_CLI_REF != '' run: | From 7a1488e11890cf7cc68981958eb3016f0fb9a7cd Mon Sep 17 00:00:00 2001 From: mikeee Date: Mon, 19 Aug 2024 14:44:00 +0100 Subject: [PATCH 4/8] chore: update ignores to all targets Signed-off-by: mikeee --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 4b3c0e7..7ac2035 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ # Generated by Cargo # will have compiled files and executables -/target/ +target/ # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html From b3e54d82825f1b05b986f37e66084df257e0fab2 Mon Sep 17 00:00:00 2001 From: mikeee Date: Mon, 19 Aug 2024 14:48:19 +0100 Subject: [PATCH 5/8] ci: migrate rust action, auth protoc setup, build examples and proto-gen Signed-off-by: mikeee --- .github/workflows/ci.yml | 46 +++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2984f68..3e67cf9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ env: CARGO_TERM_COLOR: always CARGO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} PROTOC_VERSION: 3.x - RUST_TOOLCHAIN: 1.79.0 + RUSTUP_TOOLCHAIN: stable jobs: lint: @@ -24,17 +24,17 @@ jobs: runs-on: ubuntu-latest steps: - - name: Install Rust Toolchain - uses: actions-rs/toolchain@v1 + - name: Install Rust + uses: dtolnay/rust-toolchain@main with: - toolchain: ${{ env.RUST_TOOLCHAIN }} - override: true - components: rustfmt, clippy + toolchain: stable + components: clippy, rustfmt - name: Install Protoc uses: arduino/setup-protoc@v1 with: + repo-token: ${{ secrets.GITHUB_TOKEN }} version: ${{ env.PROTOC_VERSION }} - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: cargo fmt run: cargo fmt -- --check --color ${{ env.CARGO_TERM_COLOR }} - name: cargo clippy @@ -46,21 +46,27 @@ jobs: runs-on: ubuntu-latest steps: - - name: Install Rust Toolchain - uses: actions-rs/toolchain@v1 + - name: Install Rust + uses: dtolnay/rust-toolchain@main with: - toolchain: ${{ env.RUST_TOOLCHAIN }} - override: true - components: rustfmt, clippy + toolchain: stable + components: clippy, rustfmt - name: Install Protoc uses: arduino/setup-protoc@v1 with: + repo-token: ${{ secrets.GITHUB_TOKEN }} version: ${{ env.PROTOC_VERSION }} - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Build run: cargo build - name: Build examples - run: cargo build --examples + run: | + cd examples + cargo build --examples + - name: Build proto-gen + run: | + cd proto-gen + cargo build - name: Run Tests run: cargo test --all-targets @@ -71,17 +77,17 @@ jobs: if: startswith(github.ref, 'refs/tags/v') steps: - - name: Install Rust Toolchain - uses: actions-rs/toolchain@v1 + - name: Install Rust + uses: dtolnay/rust-toolchain@main with: - toolchain: ${{ env.RUST_TOOLCHAIN }} - override: true - components: rustfmt, clippy + toolchain: stable + components: clippy, rustfmt - name: Install Protoc uses: arduino/setup-protoc@v1 with: + repo-token: ${{ secrets.GITHUB_TOKEN }} version: ${{ env.PROTOC_VERSION }} - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: cargo publish dapr-macros run: cargo publish --manifest-path dapr-macros/Cargo.toml --token ${{ env.CARGO_TOKEN }} - name: cargo publish dapr From c0b8949f902e7a1c5689bc8cded0f00f7b72860e Mon Sep 17 00:00:00 2001 From: mikeee Date: Mon, 19 Aug 2024 14:49:38 +0100 Subject: [PATCH 6/8] fix: change branch name reference to master Signed-off-by: mikeee --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3e67cf9..5a1d549 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: steps: - name: Install Rust - uses: dtolnay/rust-toolchain@main + uses: dtolnay/rust-toolchain@master with: toolchain: stable components: clippy, rustfmt @@ -47,7 +47,7 @@ jobs: steps: - name: Install Rust - uses: dtolnay/rust-toolchain@main + uses: dtolnay/rust-toolchain@master with: toolchain: stable components: clippy, rustfmt @@ -78,7 +78,7 @@ jobs: steps: - name: Install Rust - uses: dtolnay/rust-toolchain@main + uses: dtolnay/rust-toolchain@master with: toolchain: stable components: clippy, rustfmt From 3c00da4c6966669ee07d0da5b18c1e4caddf951b Mon Sep 17 00:00:00 2001 From: mikeee Date: Mon, 19 Aug 2024 14:54:55 +0100 Subject: [PATCH 7/8] ci: bump setup-protoc to v3 Signed-off-by: mikeee --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5a1d549..eacf011 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,7 @@ jobs: toolchain: stable components: clippy, rustfmt - name: Install Protoc - uses: arduino/setup-protoc@v1 + uses: arduino/setup-protoc@v3 with: repo-token: ${{ secrets.GITHUB_TOKEN }} version: ${{ env.PROTOC_VERSION }} @@ -52,7 +52,7 @@ jobs: toolchain: stable components: clippy, rustfmt - name: Install Protoc - uses: arduino/setup-protoc@v1 + uses: arduino/setup-protoc@v3 with: repo-token: ${{ secrets.GITHUB_TOKEN }} version: ${{ env.PROTOC_VERSION }} @@ -83,7 +83,7 @@ jobs: toolchain: stable components: clippy, rustfmt - name: Install Protoc - uses: arduino/setup-protoc@v1 + uses: arduino/setup-protoc@v3 with: repo-token: ${{ secrets.GITHUB_TOKEN }} version: ${{ env.PROTOC_VERSION }} From 40a96cbc98f6e079227841613456feeb7ff765e9 Mon Sep 17 00:00:00 2001 From: mikeee Date: Mon, 19 Aug 2024 15:21:07 +0100 Subject: [PATCH 8/8] ci: install protoc pinned 24.4 Signed-off-by: mikeee --- .github/workflows/ci.yml | 2 +- .github/workflows/validate-examples.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eacf011..1874e6e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ on: env: CARGO_TERM_COLOR: always CARGO_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} - PROTOC_VERSION: 3.x + PROTOC_VERSION: 24.4 RUSTUP_TOOLCHAIN: stable jobs: diff --git a/.github/workflows/validate-examples.yml b/.github/workflows/validate-examples.yml index e79692c..30d8fd0 100644 --- a/.github/workflows/validate-examples.yml +++ b/.github/workflows/validate-examples.yml @@ -248,7 +248,7 @@ jobs: - name: Install Protoc uses: arduino/setup-protoc@v3 with: - version: "25.2" + version: "24.4" repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Set up Dapr CLI ${{ env.DAPR_CLI_VERSION }}