Skip to content

Commit 0acd8b3

Browse files
committed
chore: Update to skeleton
1 parent 2c151bc commit 0acd8b3

19 files changed

+682
-103
lines changed

.cargo/config

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[target.x86_64-pc-windows-msvc]
2+
rustflags = ["-Ctarget-feature=+crt-static"]
3+
4+
[target.i686-pc-windows-msvc]
5+
rustflags = ["-Ctarget-feature=+crt-static"]

.clippy.toml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
msrv = "1.54.0" # MSRV

.github/dependabot.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: cargo
4+
directory: "/"
5+
schedule:
6+
interval: monthly
7+
time: "07:00"
8+
open-pull-requests-limit: 10
9+
10+
- package-ecosystem: "github-actions"
11+
directory: "/"
12+
schedule:
13+
interval: monthly
14+
time: "07:00"
15+
open-pull-requests-limit: 10

.github/settings.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# These settings are synced to GitHub by https://probot.github.io/apps/settings/
2+
3+
repository:
4+
description: Command-line tool to run Rust \"scripts\" which can make use of crates.
5+
homepage: https://rust-script.org
6+
topics: rust cargo script
7+
has_issues: true
8+
has_projects: false
9+
has_wiki: false
10+
has_downloads: true
11+
default_branch: main
12+
13+
allow_squash_merge: true
14+
allow_merge_commit: true
15+
allow_rebase_merge: true
16+
17+
# Manual: allow_auto_merge: true, see https://github.com/probot/settings/issues/402
18+
delete_branch_on_merge: true
19+
20+
labels:
21+
# Type
22+
- name: bug
23+
color: '#b60205'
24+
description: Not as expected
25+
- name: enhancement
26+
color: '#1d76db'
27+
description: Improve the expected
28+
# Flavor
29+
- name: question
30+
color: "#cc317c"
31+
description: Uncertainty is involved
32+
- name: breaking-change
33+
color: "#e99695"
34+
- name: good first issue
35+
color: '#c2e0c6'
36+
description: Help wanted!
37+
38+
branches:
39+
- name: main
40+
protection:
41+
required_pull_request_reviews: null
42+
required_conversation_resolution: true
43+
required_status_checks:
44+
# Required. Require branches to be up to date before merging.
45+
strict: false
46+
contexts: ["CI", "Lint Commits", "Spell Check with Typos"]
47+
enforce_admins: false
48+
restrictions: null

.github/workflows/audit.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Security audit
2+
on:
3+
pull_request:
4+
paths:
5+
- '**/Cargo.toml'
6+
- '**/Cargo.lock'
7+
push:
8+
paths:
9+
- '**/Cargo.toml'
10+
- '**/Cargo.lock'
11+
schedule:
12+
- cron: '1 1 1 * *'
13+
jobs:
14+
security_audit:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v3
19+
- uses: actions-rs/audit-check@v1
20+
with:
21+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/ci.yml

+123-89
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,74 @@
11
name: CI
2-
3-
on: push
4-
2+
on:
3+
pull_request:
4+
paths:
5+
- '**'
6+
- '!/*.md'
7+
- '!/docs/**'
8+
- "!/LICENSE-*"
9+
push:
10+
branches:
11+
- main
12+
paths:
13+
- '**'
14+
- '!/*.md'
15+
- '!/docs/**'
16+
- "!/LICENSE-*"
17+
schedule:
18+
- cron: '1 1 1 * *'
519
jobs:
6-
20+
ci:
21+
name: CI
22+
needs: [test, test-install-file-association, msrv, docs, rustfmt, clippy]
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Done
26+
run: exit 0
727
test:
28+
name: Test
829
strategy:
930
matrix:
10-
os: [ubuntu-latest, macos-latest, windows-latest]
31+
os: ["ubuntu-latest", "windows-latest", "macos-latest"]
32+
rust: ["stable"]
33+
continue-on-error: ${{ matrix.rust != 'stable' }}
1134
runs-on: ${{ matrix.os }}
1235
steps:
13-
- name: Checkout source
14-
uses: actions/checkout@v2
15-
- name: Setup stable rust
16-
uses: hecrj/setup-rust-action@v1
17-
with:
18-
rust-version: "stable"
19-
- name: Setup nightly rust
20-
uses: hecrj/setup-rust-action@v1
21-
with:
22-
rust-version: nightly
23-
- name: Setup MSRV rust
24-
uses: hecrj/setup-rust-action@v1
36+
- name: Checkout repository
37+
uses: actions/checkout@v3
38+
- name: Install Rust
39+
uses: actions-rs/toolchain@v1
2540
with:
26-
rust-version: "1.54.0"
27-
- name: Run unit tests
28-
run: rustc --version && cargo --version && cargo test
41+
toolchain: ${{ matrix.rust }}
42+
profile: minimal
43+
override: true
44+
- uses: Swatinem/rust-cache@v1
45+
- name: Build
46+
run: cargo test --no-run --workspace --all-features
47+
- name: Default features
48+
run: cargo test --workspace
49+
- name: All features
50+
run: cargo test --workspace --all-features
51+
- name: No-default features
52+
run: cargo test --workspace --no-default-features
2953
- name: Run script tests
3054
if: runner.os != 'Windows'
3155
run: |
3256
# Run twice to test problem with expression caching
3357
./tests/scripts/test-runner.sh
3458
./tests/scripts/test-runner.sh
3559
(cd tests/scripts/ignores-rust-toolchain && ../../../target/debug/rust-script test.rs)
36-
37-
check-format:
38-
runs-on: ubuntu-latest
39-
steps:
40-
- name: Checkout source
41-
uses: actions/checkout@v2
42-
- name: Setup rust
43-
uses: hecrj/setup-rust-action@v1
44-
- name: Install rustfmt
45-
run: rustup component add rustfmt
46-
- name: Check formatting with rustfmt
47-
run: cargo fmt -- --check
48-
49-
check-clippy:
50-
strategy:
51-
matrix:
52-
os: [ubuntu-latest, macos-latest, windows-latest]
53-
runs-on: ${{ matrix.os }}
54-
steps:
55-
- name: Checkout source
56-
uses: actions/checkout@v2
57-
- name: Setup rust
58-
uses: hecrj/setup-rust-action@v1
59-
- name: Install rustfmt
60-
run: rustup component add clippy
61-
- name: Check for clippy warnings
62-
run: cargo clippy --all-targets --all-features -- -D warnings -W clippy::cargo
63-
64-
upload-debug-builds:
65-
strategy:
66-
matrix:
67-
os: [ubuntu-latest, macos-latest, windows-latest]
68-
runs-on: ${{ matrix.os }}
69-
steps:
70-
- name: Checkout source
71-
uses: actions/checkout@v2
72-
- name: Setup rust
73-
uses: hecrj/setup-rust-action@v1
74-
- name: Build debug
75-
run: cargo build
76-
- name: Upload Windows debug build
77-
if: runner.os == 'Windows'
78-
uses: actions/upload-artifact@v2
79-
with:
80-
path: ./target/debug/rust-script.exe
81-
name: windows-binary
82-
- name: Upload macOS debug build
83-
if: runner.os == 'macOS'
84-
uses: actions/upload-artifact@v2
85-
with:
86-
path: ./target/debug/rust-script
87-
name: mac-binary
88-
- name: Upload Linux debug build
89-
if: runner.os == 'Linux'
90-
uses: actions/upload-artifact@v2
91-
with:
92-
path: ./target/debug/rust-script
93-
name: linux-binary
94-
9560
test-install-file-association:
9661
runs-on: windows-latest
9762
steps:
98-
- name: Checkout source
99-
uses: actions/checkout@v2
100-
- name: Setup rust
101-
uses: hecrj/setup-rust-action@v1
63+
- name: Checkout repository
64+
uses: actions/checkout@v3
65+
- name: Install Rust
66+
uses: actions-rs/toolchain@v1
67+
with:
68+
toolchain: stable
69+
profile: minimal
70+
override: true
71+
- uses: Swatinem/rust-cache@v1
10272
- name: Build debug
10373
run: cargo build
10474
- name: Install file association
@@ -110,11 +80,75 @@ jobs:
11080
- name: Run example script
11181
run: cmd.exe /C .\examples\hello.ers
11282
continue-on-error: true
113-
114-
security-audit:
83+
msrv:
84+
name: "Check MSRV: 1.54.0"
11585
runs-on: ubuntu-latest
11686
steps:
117-
- uses: actions/checkout@v1
118-
- uses: actions-rs/audit-check@v1
119-
with:
120-
token: ${{ secrets.GITHUB_TOKEN }}
87+
- name: Checkout repository
88+
uses: actions/checkout@v3
89+
- name: Install Rust
90+
uses: actions-rs/toolchain@v1
91+
with:
92+
toolchain: 1.54.0 # MSRV
93+
profile: minimal
94+
override: true
95+
- uses: Swatinem/rust-cache@v1
96+
- name: Default features
97+
run: cargo check --workspace --all-targets
98+
- name: All features
99+
run: cargo check --workspace --all-targets --all-features
100+
- name: No-default features
101+
run: cargo check --workspace --all-targets --no-default-features
102+
docs:
103+
name: Docs
104+
runs-on: ubuntu-latest
105+
steps:
106+
- name: Checkout repository
107+
uses: actions/checkout@v3
108+
- name: Install Rust
109+
uses: actions-rs/toolchain@v1
110+
with:
111+
toolchain: stable
112+
profile: minimal
113+
override: true
114+
- uses: Swatinem/rust-cache@v1
115+
- name: Check documentation
116+
env:
117+
RUSTDOCFLAGS: -D warnings
118+
run: cargo doc --workspace --all-features --no-deps --document-private-items
119+
rustfmt:
120+
name: rustfmt
121+
runs-on: ubuntu-latest
122+
steps:
123+
- name: Checkout repository
124+
uses: actions/checkout@v3
125+
- name: Install Rust
126+
uses: actions-rs/toolchain@v1
127+
with:
128+
# Not MSRV because its harder to jump between versions and people are
129+
# more likely to have stable
130+
toolchain: stable
131+
profile: minimal
132+
override: true
133+
components: rustfmt
134+
- uses: Swatinem/rust-cache@v1
135+
- name: Check formatting
136+
run: cargo fmt --all -- --check
137+
clippy:
138+
name: clippy
139+
runs-on: ubuntu-latest
140+
steps:
141+
- name: Checkout repository
142+
uses: actions/checkout@v3
143+
- name: Install Rust
144+
uses: actions-rs/toolchain@v1
145+
with:
146+
toolchain: 1.54.0 # MSRV
147+
profile: minimal
148+
override: true
149+
components: clippy
150+
- uses: Swatinem/rust-cache@v1
151+
- uses: actions-rs/clippy-check@v1
152+
with:
153+
token: ${{ secrets.GITHUB_TOKEN }}
154+
args: --workspace --all-features --all-targets -- -D warnings --allow deprecated

.github/workflows/committed.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Not run as part of pre-commit checks because they don't handle sending the correct commit
2+
# range to `committed`
3+
name: Lint Commits
4+
on: [pull_request]
5+
6+
jobs:
7+
committed:
8+
name: Lint Commits
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout Actions Repository
12+
uses: actions/checkout@v3
13+
with:
14+
fetch-depth: 0
15+
- name: Lint Commits
16+
uses: crate-ci/committed@master

0 commit comments

Comments
 (0)