@@ -3,50 +3,78 @@ name: CI
3
3
on :
4
4
push :
5
5
pull_request :
6
+
6
7
schedule :
7
8
- cron : ' 0 6 * * 6'
8
9
9
10
jobs :
10
- test :
11
+ try :
11
12
strategy :
12
13
fail-fast : false
13
14
matrix :
14
15
os : [ubuntu-latest, macos-latest, windows-latest]
16
+ config :
17
+ - {}
18
+ - {shards: false}
19
+ - {shards: true}
20
+ - {shards: '0.12.0', crystal: '0.35.1'}
21
+ - {shards: latest, crystal: latest}
22
+ - {shards: nightly, crystal: nightly}
23
+ exclude :
24
+ - os : windows-latest
25
+ config : {shards: '0.12.0', crystal: '0.35.1'}
26
+ - os : windows-latest
27
+ config : {shards: latest, crystal: latest}
28
+
29
+ name : crystal ${{ matrix.config.crystal }} + shards ${{ matrix.config.shards }} (${{ matrix.os }})
15
30
runs-on : ${{ matrix.os }}
31
+ defaults :
32
+ run :
33
+ shell : bash
16
34
steps :
17
35
- uses : actions/checkout@v2
18
36
- run : npm install
19
-
20
- - uses : ./
21
- with :
22
- shards : false
23
- - run : crystal eval "puts 1337"
24
- - run : ' ! shards --version'
25
-
26
37
- uses : ./
27
- with :
28
- shards : true
29
- - run : crystal eval "puts 1337"
30
- - run : shards --version
38
+ with : ${{ matrix.config }}
39
+ id : install
31
40
32
- - uses : ./
33
- with :
34
- shards : latest
35
- if : runner.os != 'Windows'
36
- - run : crystal eval "puts 1337"
37
- if : runner.os != 'Windows'
38
- - run : shards --version
39
- if : runner.os != 'Windows'
41
+ - run : |
42
+ crystal eval 'puts "test" + "ing"' | grep 'testing'
43
+ - run : |
44
+ crystal --version
45
+ - run : |
46
+ v='${{ steps.install.outputs.crystal }}'
47
+ crystal --version | grep "${v:0:9}"
48
+ if: ${{ runner.os != 'Windows' }}
49
+ - run : |
50
+ v='${{ matrix.config.crystal }}'
51
+ crystal --version | grep "$v"
52
+ if: ${{ contains(matrix.config.crystal, '.') }}
40
53
41
- - uses : ./
42
- with :
43
- shards : nightly
44
- - run : crystal eval "puts 1337"
45
- - run : shards --version
46
-
47
- - uses : ./
48
- with :
49
- crystal : nightly
54
+ - run : |
55
+ shards --version
56
+ if: ${{ !contains('false', matrix.config.shards) }}
57
+ - run : |
58
+ v='${{ steps.install.outputs.shards }}'
59
+ v="${v#v}"
60
+ shards --version | grep "${v:0:9}"
61
+ if: ${{ !contains('true|false|nightly', matrix.config.shards) }}
62
+ - run : |
63
+ v='${{ matrix.config.shards }}'
64
+ shards --version | grep "$v"
65
+ if: ${{ contains(matrix.config.shards, '.') }}
66
+ - run : |
67
+ ! shards --version
68
+ if: ${{ matrix.config.shards == 'false' }}
50
69
70
+ test :
71
+ strategy :
72
+ fail-fast : false
73
+ matrix :
74
+ os : [ubuntu-latest, macos-latest, windows-latest]
75
+ runs-on : ${{ matrix.os }}
76
+ steps :
77
+ - uses : actions/checkout@v2
78
+ - run : npm install
51
79
- run : npm test
52
80
- run : npm audit --audit-level=moderate
0 commit comments