Skip to content

Commit fc466bf

Browse files
committed
Merge remote-tracking branch 'origin/main' into HEAD
2 parents 5ebceb3 + d39fc1b commit fc466bf

File tree

330 files changed

+1591
-412
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

330 files changed

+1591
-412
lines changed

.github/workflows/bindgen.yml

Lines changed: 19 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -16,34 +16,26 @@ jobs:
1616
runs-on: ubuntu-latest
1717

1818
steps:
19-
- uses: actions/checkout@v3
19+
- uses: actions/checkout@v4
2020

2121
- name: Install stable
22-
uses: actions-rs/toolchain@v1
22+
uses: dtolnay/rust-toolchain@master
2323
with:
24-
profile: minimal
2524
# TODO: Should ideally be stable, but we use some nightly-only
2625
# features.
2726
toolchain: nightly
28-
override: true
2927
components: rustfmt, clippy
3028

3129
- name: Run rustfmt
32-
uses: actions-rs/cargo@v1
33-
with:
34-
command: fmt
35-
args: -- --check
30+
run: cargo fmt -- --check
3631

3732
- name: Run clippy
38-
uses: actions-rs/cargo@v1
39-
with:
40-
command: clippy
41-
args: --tests
33+
run: cargo clippy --tests
4234

4335
msrv:
4436
runs-on: ubuntu-latest
4537
steps:
46-
- uses: actions/checkout@v3
38+
- uses: actions/checkout@v4
4739

4840
- name: Install msrv for lib
4941
uses: dtolnay/rust-toolchain@master
@@ -70,14 +62,12 @@ jobs:
7062
env:
7163
RUSTFLAGS: -D warnings
7264
steps:
73-
- uses: actions/checkout@v3
65+
- uses: actions/checkout@v4
7466

7567
- name: Install stable
76-
uses: actions-rs/toolchain@v1
68+
uses: dtolnay/rust-toolchain@master
7769
with:
78-
profile: minimal
7970
toolchain: stable
80-
override: true
8171

8272
- name: Check without default features
8373
run: cargo check -p bindgen --no-default-features --features=runtime
@@ -87,14 +77,12 @@ jobs:
8777
env:
8878
RUSTDOCFLAGS: -D warnings
8979
steps:
90-
- uses: actions/checkout@v3
80+
- uses: actions/checkout@v4
9181

9282
- name: Install stable
93-
uses: actions-rs/toolchain@v1
83+
uses: dtolnay/rust-toolchain@master
9484
with:
95-
profile: minimal
9685
toolchain: stable
97-
override: true
9886

9987
- name: Generate documentation for `bindgen`
10088
run: cargo doc --document-private-items --no-deps -p bindgen
@@ -105,14 +93,12 @@ jobs:
10593
quickchecking:
10694
runs-on: ubuntu-latest
10795
steps:
108-
- uses: actions/checkout@v3
96+
- uses: actions/checkout@v4
10997

11098
- name: Install stable
111-
uses: actions-rs/toolchain@v1
99+
uses: dtolnay/rust-toolchain@master
112100
with:
113-
profile: minimal
114101
toolchain: stable
115-
override: true
116102

117103
# TODO: Actually run quickchecks once `bindgen` is reliable enough.
118104
- name: Build quickcheck tests
@@ -124,14 +110,12 @@ jobs:
124110
matrix:
125111
os: [ubuntu-latest, macos-12]
126112
steps:
127-
- uses: actions/checkout@v3
113+
- uses: actions/checkout@v4
128114

129115
- name: Install stable
130-
uses: actions-rs/toolchain@v1
116+
uses: dtolnay/rust-toolchain@master
131117
with:
132-
profile: minimal
133118
toolchain: stable
134-
override: true
135119

136120
- name: Test expectations
137121
run: cd bindgen-tests/tests/expectations && cargo test
@@ -187,7 +171,7 @@ jobs:
187171
no_default_features: 0
188172
feature_extra_asserts: 0
189173
steps:
190-
- uses: actions/checkout@v3
174+
- uses: actions/checkout@v4
191175

192176
- name: Install multiarch packages
193177
if: matrix.target.debian
@@ -205,12 +189,10 @@ jobs:
205189
sudo apt-get install libc6:${{matrix.target.debian}} libstdc++6:${{matrix.target.debian}}
206190
207191
- name: Install stable
208-
uses: actions-rs/toolchain@v1
192+
uses: dtolnay/rust-toolchain@master
209193
with:
210-
profile: minimal
211194
toolchain: stable
212195
target: ${{matrix.target.rust}}
213-
override: true
214196
- name: Install libtinfo
215197
if: matrix.os == 'ubuntu-latest'
216198
run: |
@@ -227,29 +209,28 @@ jobs:
227209
BINDGEN_FEATURE_RUNTIME: ${{matrix.feature_runtime}}
228210
BINDGEN_FEATURE_EXTRA_ASSERTS: ${{matrix.feature_extra_asserts}}
229211
BINDGEN_NO_DEFAULT_FEATURES: ${{matrix.no_default_features}}
212+
BINDGEN_RUST_FOR_LINUX_TEST: ${{matrix.os == 'ubuntu-latest' && matrix.llvm_version == '16.0' && matrix.feature_extra_asserts == 0 && 1 || 0}}
230213
run: ./ci/test.sh
231214

232215
check-cfg:
233216
runs-on: ubuntu-latest
234217
env:
235218
RUSTFLAGS: -D warnings
236219
steps:
237-
- uses: actions/checkout@v3
220+
- uses: actions/checkout@v4
238221

239222
- name: Install nightly
240-
uses: actions-rs/toolchain@v1
223+
uses: dtolnay/rust-toolchain@master
241224
with:
242-
profile: minimal
243225
toolchain: nightly
244-
override: true
245226

246227
- name: Check cfg
247228
run: cargo check -Z unstable-options -Z check-cfg
248229

249230
test-book:
250231
runs-on: ubuntu-latest
251232
steps:
252-
- uses: actions/checkout@v3
233+
- uses: actions/checkout@v4
253234

254235
# NOTE(emilio): Change deploy-book as well if you change this.
255236
- name: Test book

.github/workflows/bump-version.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Bump version for release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
level:
7+
description: |
8+
Select the level of the release
9+
required: true
10+
type: choice
11+
options:
12+
- minor
13+
- patch
14+
15+
jobs:
16+
bump-version:
17+
permissions:
18+
id-token: write
19+
pull-requests: write
20+
contents: write
21+
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout code
25+
uses: actions/checkout@v4
26+
27+
- name: Configure gitsign
28+
uses: chainguard-dev/actions/setup-gitsign@main
29+
30+
- name: Install cargo-release
31+
uses: taiki-e/install-action@v1
32+
with:
33+
tool: cargo-release
34+
35+
- name: Install sd
36+
uses: taiki-e/install-action@v1
37+
with:
38+
tool: sd
39+
40+
- name: Install npm
41+
uses: actions/setup-node@v4
42+
43+
- name: Install doctoc
44+
run: npm install doctoc
45+
46+
- name: Bump version
47+
run: |
48+
cargo release version ${{ inputs.level }} --execute --no-confirm
49+
50+
- name: Extract version
51+
run: |
52+
echo "version=$(cargo pkgid -p bindgen | cut -d '#' -f 2)" >> $GITHUB_ENV
53+
54+
- name: Update changelog
55+
run: |
56+
sd "# Unreleased" "# Unreleased\n## Added\n## Changed\n## Removed\n## Fixed\n## Security\n\n# ${{ env.version }} ($(date -I))" CHANGELOG.md
57+
./node_modules/doctoc/doctoc.js CHANGELOG.md
58+
59+
- name: Create PR
60+
uses: peter-evans/create-pull-request@v5
61+
with:
62+
token: ${{ secrets.GITHUB_TOKEN }}
63+
branch: bump-version/${{ env.version }}
64+
base: main
65+
commit-message: "Bump crates version to ${{ env.version }}"
66+
title: "Bump crates version to ${{ env.version }}"
67+
body: |
68+
This pull request was created automatically by GitHub Actions.

.github/workflows/create-tag.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Create tag for release
2+
3+
on:
4+
pull_request:
5+
types:
6+
- closed
7+
8+
jobs:
9+
create-tag:
10+
if: github.event.pull_request.merged == true && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name && startsWith(github.event.pull_request.head.ref, 'bump-version')
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Install rust toolchain
17+
uses: dtolnay/rust-toolchain@stable
18+
19+
- name: Extract version
20+
run: |
21+
echo "version=$(cargo pkgid -p bindgen | cut -d '#' -f 2)" >> $GITHUB_ENV
22+
23+
- name: Create tag
24+
run: |
25+
TAG_NAME="v${{ env.version }}"
26+
git tag $TAG_NAME
27+
git push origin $TAG_NAME

.github/workflows/deploy-book.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
deploy-book:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v3
12+
- uses: actions/checkout@v4
1313
with:
1414
persist-credentials: false
1515

.github/workflows/publish.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# This is triggered after the Release workflow successfully completes its run
2+
name: Publish on crates.io
23
on:
34
workflow_run:
45
workflows:
@@ -10,10 +11,12 @@ env:
1011
jobs:
1112
cargo-publish:
1213
runs-on: ubuntu-latest
13-
if: ${{ github.event.workflow_run.conclusion == 'success' }}
14+
if: ${{ (github.event.workflow_run.conclusion == 'success') && (github.event.workflow.name == 'Release') }}
1415
steps:
16+
- name: Print workflow event name
17+
run: echo "${{ github.event.workflow.name }}"
1518
- name: Checkout sources
16-
uses: actions/checkout@v3
19+
uses: actions/checkout@v4
1720
- name: Install stable toolchain
1821
uses: dtolnay/rust-toolchain@master
1922
with:

0 commit comments

Comments
 (0)