From 15b5d39cec6b87c8c18bee8b894cd6cf2b4b01f5 Mon Sep 17 00:00:00 2001 From: Joel Wachsler Date: Mon, 11 Jul 2022 14:14:17 +0000 Subject: [PATCH 1/3] Add bors --- .github/workflows/ci.yml | 28 ++++++++++++++++++++++------ .github/workflows/extra.yml | 8 +++++++- .github/workflows/publish.yml | 15 ++++++++++++--- .github/workflows/release.yml | 9 ++++++++- 4 files changed, 49 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bb50c19..730fe41 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,17 +1,25 @@ name: CI + on: push: - branches: - - '**' + branches: [main, staging, trying] + pull_request: + branches: [main] + +env: + CARGO_TERM_COLOR: always + jobs: test: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest + services: # Needed for tests to pass qbittorrent: image: linuxserver/qbittorrent:4.4.3 ports: - 8080:8080 + steps: - uses: actions/checkout@v3 @@ -27,14 +35,21 @@ jobs: profile: minimal override: true + - name: Build + uses: actions-rs/cargo@v1 + with: + command: build + args: --verbose + - name: Run tests uses: actions-rs/cargo@v1 with: command: test - args: --workspace + args: --workspace --verbose fmt: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest + steps: - uses: actions/checkout@v3 @@ -52,7 +67,8 @@ jobs: args: --all -- --check clippy: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest + steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/extra.yml b/.github/workflows/extra.yml index b81442b..1c99e6f 100644 --- a/.github/workflows/extra.yml +++ b/.github/workflows/extra.yml @@ -1,13 +1,19 @@ name: Extra + on: push: branches: - main + +env: + CARGO_TERM_COLOR: always + jobs: # Need to have the same name as where this dependency is used, # otherwise the cache key won't be the same. release: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest + steps: # build and cache this here in order to reuse it's cache in feature branches - name: Install cargo-edit diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 33c4d8b..1aae0b0 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,13 +1,20 @@ name: Publish + on: push: branches: - - 'main' + - main + +env: + CARGO_TERM_COLOR: always + jobs: tag: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest + outputs: should_publish: ${{ steps.create-and-push-tag.outputs.should_publish }} + steps: - uses: actions/checkout@v3 @@ -32,9 +39,11 @@ jobs: echo "The result is: ${{ steps.create-and-push-tag.outputs.should_publish }}" publish: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest + needs: tag if: ${{ needs.tag.outputs.should_publish == 'true' }} + steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 33c9038..81be97b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,11 +1,18 @@ name: Prepare new release + on: create: branches: + +env: + CARGO_TERM_COLOR: always + jobs: release: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest + if: "startsWith(github.ref, 'refs/heads/create_release/')" + steps: - uses: actions/checkout@v3 From 7a6caf4de3ea5f6bae3c66a3b2b64a408ff6d17b Mon Sep 17 00:00:00 2001 From: Joel Wachsler Date: Mon, 11 Jul 2022 14:15:19 +0000 Subject: [PATCH 2/3] Add bors.toml --- bors.toml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 bors.toml diff --git a/bors.toml b/bors.toml new file mode 100644 index 0000000..81bcfd1 --- /dev/null +++ b/bors.toml @@ -0,0 +1,6 @@ +delete_merged_branches = true +update_base_for_deletes = true + +status = [ + "test" +] From 92a683175018dcd82af0167c0feb8a15bf60dd4d Mon Sep 17 00:00:00 2001 From: Joel Wachsler Date: Mon, 11 Jul 2022 14:22:35 +0000 Subject: [PATCH 3/3] Increase retries --- qbittorrent-web-api-gen/tests/return_type_enum.rs | 2 +- .../tests/return_type_with_optional_params.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qbittorrent-web-api-gen/tests/return_type_enum.rs b/qbittorrent-web-api-gen/tests/return_type_enum.rs index 8b46529..c557513 100644 --- a/qbittorrent-web-api-gen/tests/return_type_enum.rs +++ b/qbittorrent-web-api-gen/tests/return_type_enum.rs @@ -17,7 +17,7 @@ async fn main() -> Result<()> { const TORRENT_URL: &str = "http://www.legittorrents.info/download.php?id=5cc013e801095be61d768e609e3039da58616fd0&f=Oddepoxy%20-%20Oddepoxy%20(2013)%20[OGG%20320%20CBR].torrent"; let _ = api.torrent_management().add(TORRENT_URL).send().await?; - let mut tries = 5; + let mut tries = 10; while tries > 0 { let info = api.torrent_management().info().send().await?; if let Some(first) = &info.get(0) { diff --git a/qbittorrent-web-api-gen/tests/return_type_with_optional_params.rs b/qbittorrent-web-api-gen/tests/return_type_with_optional_params.rs index 8b46529..c557513 100644 --- a/qbittorrent-web-api-gen/tests/return_type_with_optional_params.rs +++ b/qbittorrent-web-api-gen/tests/return_type_with_optional_params.rs @@ -17,7 +17,7 @@ async fn main() -> Result<()> { const TORRENT_URL: &str = "http://www.legittorrents.info/download.php?id=5cc013e801095be61d768e609e3039da58616fd0&f=Oddepoxy%20-%20Oddepoxy%20(2013)%20[OGG%20320%20CBR].torrent"; let _ = api.torrent_management().add(TORRENT_URL).send().await?; - let mut tries = 5; + let mut tries = 10; while tries > 0 { let info = api.torrent_management().info().send().await?; if let Some(first) = &info.get(0) {