1
1
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 * *'
5
19
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
7
27
test :
28
+ name : Test
8
29
strategy :
9
30
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' }}
11
34
runs-on : ${{ matrix.os }}
12
35
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
25
40
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
29
53
- name : Run script tests
30
54
if : runner.os != 'Windows'
31
55
run : |
32
56
# Run twice to test problem with expression caching
33
57
./tests/scripts/test-runner.sh
34
58
./tests/scripts/test-runner.sh
35
59
(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
-
95
60
test-install-file-association :
96
61
runs-on : windows-latest
97
62
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
102
72
- name : Build debug
103
73
run : cargo build
104
74
- name : Install file association
@@ -110,11 +80,75 @@ jobs:
110
80
- name : Run example script
111
81
run : cmd.exe /C .\examples\hello.ers
112
82
continue-on-error : true
113
-
114
- security-audit :
83
+ msrv :
84
+ name : " Check MSRV: 1.54.0 "
115
85
runs-on : ubuntu-latest
116
86
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
0 commit comments