From c890066ec22866f8fe73f337eb7ce564054f7e69 Mon Sep 17 00:00:00 2001 From: Philippe Llerena Date: Sat, 16 Dec 2023 17:50:10 +0100 Subject: [PATCH 1/8] parallel with no cache --- .github/workflows/rust.yml | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 22e0587..55335a9 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -10,29 +10,19 @@ env: CARGO_TERM_COLOR: always jobs: - build: - + build&test: runs-on: ubuntu-latest - steps: - uses: actions/checkout@v3 - - name: ⚡ Cache - uses: actions/cache@v3 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - target - key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - restore-keys: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - uses: dtolnay/rust-toolchain@stable - - name: 🔨 Build run: cargo build - - name: ✔️ Tests run: cargo test - + bench: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable - name: ⏲️ Bench run: cargo bench \ No newline at end of file From a228455de36033544ed5e00de980bdcf7b7a1520 Mon Sep 17 00:00:00 2001 From: Philippe Llerena Date: Sat, 16 Dec 2023 17:51:20 +0100 Subject: [PATCH 2/8] ci: fix ci name --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 55335a9..fda4a24 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -10,7 +10,7 @@ env: CARGO_TERM_COLOR: always jobs: - build&test: + build_test: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 From 64622f7a7f0f4877a870f3c8e0ded65d7b0942af Mon Sep 17 00:00:00 2001 From: Philippe Llerena Date: Sat, 16 Dec 2023 18:00:40 +0100 Subject: [PATCH 3/8] ci: add test publish --- .github/workflows/rust.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index fda4a24..f1b20e3 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -25,4 +25,12 @@ jobs: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@stable - name: ⏲️ Bench - run: cargo bench \ No newline at end of file + run: cargo bench + fake_release: + runs-on: ubuntu-latest + needs: [build_test] + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + - name: 📦 Fake Delivery + run: cargo publish --dry-run \ No newline at end of file From addc15db820af9b809fa717c02f699d901681f42 Mon Sep 17 00:00:00 2001 From: Philippe Llerena Date: Sat, 16 Dec 2023 18:05:33 +0100 Subject: [PATCH 4/8] ci: use kayto dry run --- .github/workflows/rust.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index f1b20e3..dd1b096 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -26,11 +26,17 @@ jobs: - uses: dtolnay/rust-toolchain@stable - name: ⏲️ Bench run: cargo bench - fake_release: + dry_publish: runs-on: ubuntu-latest needs: [build_test] steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - - name: 📦 Fake Delivery - run: cargo publish --dry-run \ No newline at end of file + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - uses: katyo/publish-crates@v2 + with: + path: './packages' + args: --no-verify + dry-run: true \ No newline at end of file From 3a7f0b97d726e74bc82a47b8eef83744cf2b94c1 Mon Sep 17 00:00:00 2001 From: Philippe Llerena Date: Sat, 16 Dec 2023 18:07:19 +0100 Subject: [PATCH 5/8] ci: fix dry publish --- .github/workflows/rust.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index dd1b096..91b6a18 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -21,6 +21,7 @@ jobs: run: cargo test bench: runs-on: ubuntu-latest + needs: [build_test] steps: - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@stable @@ -37,6 +38,4 @@ jobs: override: true - uses: katyo/publish-crates@v2 with: - path: './packages' - args: --no-verify dry-run: true \ No newline at end of file From fdb749c4bcf97f0d18d2975c0c7878b15a73b529 Mon Sep 17 00:00:00 2001 From: Philippe Llerena Date: Sat, 16 Dec 2023 18:16:26 +0100 Subject: [PATCH 6/8] ci: remove many intermediate --- .github/workflows/publish.yml | 25 ------------------- .github/workflows/release.yml | 24 ------------------- .github/workflows/rust.yml | 45 ++++++++++++++++++++++++++++++++--- 3 files changed, 42 insertions(+), 52 deletions(-) delete mode 100644 .github/workflows/publish.yml delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 321b46e..0000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Publish in create - -on: - push: - tags: - - '*' - -env: - CARGO_TERM_COLOR: always - -jobs: - publish: - - runs-on: ubuntu-latest - container: ghcr.io/doubleailes/rust-docker-nextest:latest - - steps: - - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@stable - with: - toolchain: stable - override: true - - uses: katyo/publish-crates@v2 - with: - registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 08e91ff..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,24 +0,0 @@ -# .github/workflows/release.yml - -on: - release: - types: [created] - -jobs: - release: - name: release ${{ matrix.target }} - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - target: [x86_64-pc-windows-gnu, x86_64-unknown-linux-musl, x86_64-apple-darwin] - steps: - - uses: actions/checkout@master - - name: Compile and release - uses: rust-build/rust-build.action@v1.4.3 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - RUSTTARGET: ${{ matrix.target }} - EXTRA_FILES: "README.md LICENSE" - TOOLCHAIN_VERSION: 1.72 diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 91b6a18..edbf524 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -2,9 +2,16 @@ name: test on: push: - branches: [ main ] + branches: + - main + - master + tags: + - '*' pull_request: - branches: [ main ] + workflow_dispatch: + release: + types: [created] + env: CARGO_TERM_COLOR: always @@ -38,4 +45,36 @@ jobs: override: true - uses: katyo/publish-crates@v2 with: - dry-run: true \ No newline at end of file + dry-run: true + publish: + runs-on: ubuntu-latest + needs: [dry_publish] + if: "startsWith(github.ref, 'refs/tags/')" # only publish on tags + steps: + - uses: actions/checkout@v3 + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - uses: katyo/publish-crates@v2 + with: + registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} + release: + runs-on: ubuntu-latest + name: release ${{ matrix.target }} + if: github.event_name == 'release' && github.event.action == 'created' + needs: [publish] + strategy: + fail-fast: false + matrix: + target: [x86_64-pc-windows-gnu, x86_64-unknown-linux-musl, x86_64-apple-darwin] + steps: + - uses: actions/checkout@master + - name: Compile and release + uses: rust-build/rust-build.action@v1.4.3 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + RUSTTARGET: ${{ matrix.target }} + EXTRA_FILES: "README.md LICENSE" + TOOLCHAIN_VERSION: 1.74 \ No newline at end of file From 494b7435897ab5eafc83e8189ce6fa2a28c59a30 Mon Sep 17 00:00:00 2001 From: Philippe Llerena Date: Sat, 16 Dec 2023 18:17:05 +0100 Subject: [PATCH 7/8] ci: fix indent error --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index edbf524..9f05cf3 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -63,7 +63,7 @@ jobs: runs-on: ubuntu-latest name: release ${{ matrix.target }} if: github.event_name == 'release' && github.event.action == 'created' - needs: [publish] + needs: [publish] strategy: fail-fast: false matrix: From faab5155f3abacba737347372cd160fc8a6fd0a9 Mon Sep 17 00:00:00 2001 From: Philippe Llerena Date: Sat, 16 Dec 2023 18:18:59 +0100 Subject: [PATCH 8/8] ci: reorg the release matrix --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 9f05cf3..3c3dd8e 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -63,7 +63,7 @@ jobs: runs-on: ubuntu-latest name: release ${{ matrix.target }} if: github.event_name == 'release' && github.event.action == 'created' - needs: [publish] + needs: [dry_publish] strategy: fail-fast: false matrix: