Skip to content

Commit 33bd24d

Browse files
committed
Improve event triggers for crates.io install test
This moves the `installation` test, which tests if installation works from crates.io, out of the main `ci.yml` workflow and to a new workflow `install.yml` that runs after a new release is made (rather than when commits are pushed or pull requests are opened or updated), as well as once a week and if it is manually triggered. Multiple events occur in connection with a release. This includes the creation and publication of the GitHub release. The could trigger on an explicitly release-related event, but it instead triggers on the `push` event, for tags only, where the tag starts with `v`. All these events take place after the crate has been uploaded to crates.io for the release, so installation should succeed. The reason for running when the version tag is pushed is that, since `cargo-smart-release` publishes itself, and it creates and pushes the version tag before it creates the GitHub release, this will allow it to begin running sooner and thus catch and notify developers of any installation problems a bit earlier: https://github.com/GitoxideLabs/cargo-smart-release/blob/d59c889b5cd931ac22c27e02ef2af063834f6b11/src/command/release/mod.rs#L445-L456 But it would also be fine to trigger on a GitHub-release related event, and it could be changed to that if the need arises. For scheduled runs, this runs once a week and is triggered on the same day and at the same time as the `rust-next.yml` workflow. This is so that their result can be compared, mainly with the idea that if `rust-next.yml` fails unexpectedly, the `install.yml` run may help indicate whether recent unpublished changes in `cargo-smart-release` are plausibly the cause. Fixes GitoxideLabs#56
1 parent d59c889 commit 33bd24d

File tree

3 files changed

+32
-14
lines changed

3 files changed

+32
-14
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
permissions:
2323
contents: none
2424
name: CI
25-
needs: [test, docs, rustfmt, clippy, installation]
25+
needs: [test, docs, rustfmt, clippy]
2626
runs-on: ubuntu-latest
2727
steps:
2828
- name: Done
@@ -51,18 +51,6 @@ jobs:
5151
if: ${{ matrix.os != 'windows-latest' }} # on windows, journey tests don't run yet and it's not important enough right now
5252
run: just ci-test
5353

54-
installation:
55-
name: Installation
56-
strategy:
57-
matrix:
58-
os: ["ubuntu-latest", "windows-latest"]
59-
rust: ["stable"]
60-
continue-on-error: ${{ matrix.rust != 'stable' }}
61-
runs-on: ${{ matrix.os }}
62-
steps:
63-
- name: "Installation from crates.io: cargo-smart-release"
64-
run: cargo install --debug --force cargo-smart-release
65-
6654
lockfile:
6755
runs-on: ubuntu-latest
6856
steps:

.github/workflows/install.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Installation
2+
3+
permissions:
4+
contents: read
5+
6+
on:
7+
push:
8+
tags:
9+
- 'v*'
10+
schedule:
11+
- cron: '1 1 1 * *'
12+
workflow_dispatch:
13+
14+
env:
15+
RUST_BACKTRACE: 1
16+
CARGO_TERM_COLOR: always
17+
CLICOLOR: 1
18+
19+
jobs:
20+
installation:
21+
name: Installation
22+
strategy:
23+
matrix:
24+
os: ["ubuntu-latest", "windows-latest"]
25+
rust: ["stable"]
26+
continue-on-error: ${{ matrix.rust != 'stable' }}
27+
runs-on: ${{ matrix.os }}
28+
steps:
29+
- name: "Installation from crates.io: cargo-smart-release"
30+
run: cargo install --debug --force cargo-smart-release

.github/workflows/rust-next.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
with:
5252
toolchain: stable
5353
- uses: Swatinem/rust-cache@v2
54-
- name: Update dependencues
54+
- name: Update dependencies
5555
run: cargo update
5656
- name: Default features
5757
run: cargo test --workspace --all-targets

0 commit comments

Comments
 (0)