Skip to content

Commit e9256fc

Browse files
Update dev environment & CI (#105)
1 parent b213435 commit e9256fc

8 files changed

Lines changed: 45 additions & 21 deletions

File tree

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
FROM ghcr.io/musicalninjas/pyo3-devcontainer:latest@sha256:adbb63a1847e6e0d38a815eac48bf57b8bf2b12996263cdf4daf3ebeeb38e08d
1+
FROM ghcr.io/musicalninjadad/rust-devcontainer:latest@sha256:243aac918fd1a9bf696b74543d839dc52bcb3e95d9eb550b1641af401a470488

.devcontainer/devcontainer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
"build": {
33
"dockerfile": "Dockerfile"
44
},
5+
// required so that command line & analyzer can share builds
56
"remoteEnv": {
6-
"RUSTC_BOOTSTRAP": "1"
7+
"RUSTC_BOOTSTRAP": "1",
8+
"CARGO_INCREMENTAL": "1"
79
},
10+
"updateContentCommand": "rustup install",
811
"customizations": {
912
"vscode": {
1013
"extensions": [
@@ -21,8 +24,6 @@
2124
// rust
2225
"rust-analyzer.interpret.tests": true,
2326
"rust-analyzer.testExplorer": true,
24-
// use subdirectory of target for analyzer builds
25-
"rust-analyzer.cargo.targetDir": true,
2627
// force BOOTSTRAP (always used for test builds - see https://github.com/rust-lang/rust-analyzer/issues/17149)
2728
"rust-analyzer.cargo.extraEnv": {
2829
"RUSTC_BOOTSTRAP": "1",

.github/dependabot.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
version: 2
22
updates:
33
- package-ecosystem: "cargo"
4-
directory: "/"
4+
directories:
5+
- "/"
56
schedule:
67
interval: "daily"
8+
cooldown:
9+
default-days: 10
710
- package-ecosystem: "docker"
811
directory: "/.devcontainer"
912
schedule:
@@ -16,3 +19,5 @@ updates:
1619
directory: "/"
1720
schedule:
1821
interval: "daily"
22+
cooldown:
23+
default-days: 10
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Dependabot automation
2-
on: pull_request
2+
on:
3+
pull_request:
4+
paths-ignore:
5+
# Do not auto-approve changes to publishing workflow!
6+
- ".github/workflows/rust-publish.yml"
37

48
permissions:
59
contents: write
@@ -8,6 +12,7 @@ permissions:
812
jobs:
913
merge:
1014
runs-on: ubuntu-latest
15+
# Manually set the repo name so this doesn't run on forks
1116
if: github.event.pull_request.user.login == 'dependabot[bot]' && github.repository == 'MusicalNinjaDad/try_v2'
1217
steps:
1318
- name: Ensure this is a valid dependabot PR
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ jobs:
2121
runs-on: ubuntu-latest
2222
steps:
2323
- uses: actions/checkout@v6
24+
- uses: rust-lang/crates-io-auth-action@bbd81622f20ce9e2dd9622e3218b975523e45bbe #v1.0.4
25+
id: auth
2426
- name: Publish
2527
env:
26-
CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }}
28+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
2729
run:
28-
cargo +nightly publish
30+
cargo publish

.github/workflows/rust-stability.yml

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
11
name: Monthly stability checks
22

33
on:
4-
workflow_dispatch:
5-
workflow_call:
64
pull_request:
5+
push:
6+
paths:
7+
- ".github/workflows/rust-stability.yml"
78
schedule:
89
- cron: '0 3 6 * *'
9-
10-
permissions:
11-
contents: read
12-
issues: write
10+
workflow_dispatch:
11+
workflow_call:
1312

1413
env:
1514
CARGO_TERM_COLOR: always
16-
RUSTC_BOOTSTRAP: 1
1715

1816
jobs:
1917

@@ -26,9 +24,11 @@ jobs:
2624
steps:
2725
- uses: actions/checkout@v6
2826
- name: update rust
29-
run: rustup set profile default && rustup update && rustup default ${{ matrix.channel }}
27+
run: rustup set profile default && rustup install ${{ matrix.channel }}
28+
- name: Set bootstrap
29+
run: test "${{ matrix.channel }}" != "nightly" && echo "RUSTC_BOOTSTRAP=1" >> $GITHUB_ENV || true
3030
- name: Run tests
31-
run: cargo test --no-fail-fast
31+
run: cargo "+${{ matrix.channel }}" test --no-fail-fast
3232

3333
lint:
3434
strategy:
@@ -39,14 +39,19 @@ jobs:
3939
steps:
4040
- uses: actions/checkout@v6
4141
- name: update rust
42-
run: rustup set profile default && rustup update && rustup default ${{ matrix.channel }}
42+
run: rustup set profile default && rustup install ${{ matrix.channel }}
43+
- name: Set bootstrap
44+
run: test "${{ matrix.channel }}" != "nightly" && echo "RUSTC_BOOTSTRAP=1" >> $GITHUB_ENV || true
4345
- name: clippy
44-
run: cargo clippy -- --deny warnings
46+
run: cargo +${{ matrix.channel }} clippy -- --deny warnings
4547

4648
report:
4749
if: ${{ always() }}
4850
needs: [test, lint]
4951
runs-on: ubuntu-latest
52+
permissions:
53+
contents: read
54+
issues: write
5055
steps:
5156
- uses: actions/checkout@v6
5257
- name: Create issue on failure

.github/workflows/rust.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ on:
55
paths:
66
- "**.rs"
77
- "Cargo.toml"
8+
- "rust-toolchain.toml"
89
- ".github/workflows/rust.yml"
910
pull_request:
1011
workflow_call:
1112

1213
env:
1314
CARGO_TERM_COLOR: always
14-
RUSTC_BOOTSTRAP: 1
1515

1616
jobs:
1717

@@ -64,10 +64,13 @@ jobs:
6464

6565
runs-on: ubuntu-latest
6666

67+
env:
68+
RUSTC_BOOTSTRAP: 1
69+
6770
steps:
6871
- uses: actions/checkout@v6
6972
- name: install cargo-msrv
70-
uses: taiki-e/install-action@v2.79.2
73+
uses: taiki-e/install-action@v2.75.27
7174
with:
7275
tool: cargo-msrv
7376
- name: check MSRV

rust-toolchain.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[toolchain]
2+
channel = "nightly"
3+
profile = "default"

0 commit comments

Comments
 (0)