Skip to content

Commit 8e33a95

Browse files
authored
chore(ci): faster builds (fossas#5)
1 parent 0defd40 commit 8e33a95

File tree

7 files changed

+70
-26
lines changed

7 files changed

+70
-26
lines changed

.github/workflows/check-dynamic.yml

Lines changed: 47 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,35 +2,65 @@ name: dynamic
22
on: pull_request
33

44
jobs:
5-
check-build:
5+
check-test:
66
strategy:
77
matrix:
88
settings:
99
- host: windows-latest
10-
setup: echo "no setup"
11-
build: cargo build
10+
target: x86_64-pc-windows-msvc
11+
- host: ubuntu-latest
12+
target: x86_64-unknown-linux-gnu
13+
- host: ubuntu-latest
14+
target: aarch64-unknown-linux-gnu
1215
- host: ubuntu-latest
13-
setup: echo "no setup"
14-
build: cargo build
16+
target: x86_64-unknown-linux-musl
1517
- host: macos-latest
16-
setup: |
17-
rustup target add aarch64-apple-darwin
18-
rustup target add x86_64-apple-darwin
19-
build: |
20-
cargo build --target aarch64-apple-darwin
21-
cargo build --target x86_64-apple-darwin
18+
target: aarch64-apple-darwin
19+
- host: macos-latest
20+
target: x86_64-apple-darwin
2221

2322
runs-on: ${{ matrix.settings.host }}
24-
name: test / ${{ matrix.settings.host }}
23+
name: test / ${{ matrix.settings.host }} / ${{ matrix.settings.target }}
2524
steps:
2625
- uses: actions/checkout@v4
27-
- uses: dtolnay/rust-toolchain@stable
26+
- uses: dtolnay/rust-toolchain@master
27+
with:
28+
toolchain: stable
29+
targets: ${{ matrix.settings.target }}
2830
- uses: taiki-e/install-action@nextest
2931
- uses: Swatinem/[email protected]
3032
with:
31-
key: ${{ matrix.settings.host }}
32-
- run: ${{ matrix.settings.setup }}
33-
- run: ${{ matrix.settings.build }}
34-
- run: cargo check --release --all --bins --examples --tests
33+
key: test_${{ matrix.settings.host }}_${{ matrix.settings.target }}
3534
- run: cargo nextest run --all-targets
3635
- run: cargo test --doc
36+
37+
check-build:
38+
strategy:
39+
matrix:
40+
settings:
41+
- host: windows-latest
42+
target: x86_64-pc-windows-msvc
43+
- host: ubuntu-latest
44+
target: x86_64-unknown-linux-gnu
45+
- host: ubuntu-latest
46+
target: aarch64-unknown-linux-gnu
47+
- host: ubuntu-latest
48+
target: x86_64-unknown-linux-musl
49+
- host: macos-latest
50+
target: aarch64-apple-darwin
51+
- host: macos-latest
52+
target: x86_64-apple-darwin
53+
54+
runs-on: ${{ matrix.settings.host }}
55+
name: build / ${{ matrix.settings.host }} / ${{ matrix.settings.target }}
56+
steps:
57+
- uses: actions/checkout@v4
58+
- uses: dtolnay/rust-toolchain@master
59+
with:
60+
toolchain: stable
61+
targets: ${{ matrix.settings.target }}
62+
- uses: Swatinem/[email protected]
63+
with:
64+
key: build_${{ matrix.settings.host }}_${{ matrix.settings.target }}
65+
- run: cargo check --all --bins --examples --tests
66+
- run: cargo build

.github/workflows/release.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
# we specify bash to get pipefail; it guards against the `curl` command
6464
# failing. otherwise `sh` won't catch that `curl` returned non-0
6565
shell: bash
66-
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.25.1/cargo-dist-installer.sh | sh"
66+
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.26.1/cargo-dist-installer.sh | sh"
6767
- name: Cache dist
6868
uses: actions/upload-artifact@v4
6969
with:
@@ -107,6 +107,7 @@ jobs:
107107
# - N "local" tasks that build each platform's binaries and platform-specific installers
108108
matrix: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix }}
109109
runs-on: ${{ matrix.runner }}
110+
container: ${{ matrix.container && matrix.container.image || null }}
110111
env:
111112
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
112113
BUILD_MANIFEST_NAME: target/distrib/${{ join(matrix.targets, '-') }}-dist-manifest.json
@@ -117,8 +118,15 @@ jobs:
117118
- uses: actions/checkout@v4
118119
with:
119120
submodules: recursive
121+
- name: Install Rust non-interactively if not already installed
122+
if: ${{ matrix.container }}
123+
run: |
124+
if ! command -v cargo > /dev/null 2>&1; then
125+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
126+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
127+
fi
120128
- name: Install dist
121-
run: ${{ matrix.install_dist }}
129+
run: ${{ matrix.install_dist.run }}
122130
# Get the dist-manifest
123131
- name: Fetch local artifacts
124132
uses: actions/download-artifact@v4
@@ -143,7 +151,7 @@ jobs:
143151
run: |
144152
# Parse out what we just built and upload it to scratch storage
145153
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
146-
jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT"
154+
dist print-upload-files-from-manifest --manifest dist-manifest.json >> "$GITHUB_OUTPUT"
147155
echo "EOF" >> "$GITHUB_OUTPUT"
148156
149157
cp dist-manifest.json "$BUILD_MANIFEST_NAME"

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Changelog
22

3-
## [0.3.3](https://github.com/fossas/circe/releases/tag/0.3.3)
3+
## [v0.3.3](https://github.com/fossas/circe/releases/tag/v0.3.3)
44

55
_Released: 2024-12-14_
66

bin/release.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
tag-prefix = ""
22
shared-version = true
3-
pre-release-hook = ["git", "cliff", "--workdir", "..", "-o", "../CHANGELOG.md", "--tag", "{{version}}" ]
3+
pre-release-hook = ["git", "cliff", "--workdir", "..", "--tag", "{{version}}" ]

cliff.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ footer = """
2929
"""
3030

3131
trim = true
32-
33-
render_always = true
3432
output = "CHANGELOG.md"
3533

3634
[git]

dist-workspace.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ members = ["cargo:."]
44
# Config for 'dist'
55
[dist]
66
# The preferred dist version to use in CI (Cargo.toml SemVer syntax)
7-
cargo-dist-version = "0.25.1"
7+
cargo-dist-version = "0.26.1"
88
# CI backends to support
99
ci = "github"
1010
# The installers to generate for each app
1111
installers = ["shell", "powershell"]
1212
# Target platforms to build apps for (Rust target-triple syntax)
13-
targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl", "x86_64-pc-windows-msvc"]
13+
targets = ["aarch64-apple-darwin", "aarch64-unknown-linux-gnu", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-unknown-linux-musl", "x86_64-pc-windows-msvc"]
1414
# Path that installers should place binaries in
1515
install-path = "~/.circe/bin"
1616
# Whether to install an updater program

docs/dev/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ if this is not realistic at minimum every non-bugfix release **must** ensure dep
6363
> [!TIP]
6464
> Requires `cargo-release` and `git-cliff` to be installed.
6565
66+
> [!NOTE]
67+
> In order to have your changes integrate with the changelog,
68+
> make sure to merge commits to `main` with a meaningful commit message.
69+
>
70+
> Additionally, if those commits are parseable as [conventional commits](https://www.conventionalcommits.org),
71+
> they will be grouped into sections in the changelog.
72+
> See the `cliff.toml` file for more details and group examples.
73+
6674
Use `cargo release` to create a release.
6775
Since we cannot push to `main` directly, perform the steps below:
6876

0 commit comments

Comments
 (0)