-
Notifications
You must be signed in to change notification settings - Fork 19
166 lines (163 loc) · 5.39 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
name: CI
on:
merge_group:
push:
branches:
- master # Allows codecov to receive current HEAD information for each commit merged into master
pull_request:
branches:
- master
schedule:
- cron: '15 1 * * *' # Nightly at 01:15
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check_spelling:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check Spelling
uses: crate-ci/[email protected]
check_format:
strategy:
matrix:
crystal:
- latest
- nightly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
with:
crystal: ${{ matrix.crystal }}
- name: Check Format
run: crystal tool format --check
coding_standards:
runs-on: ubuntu-latest
container:
image: crystallang/crystal:latest
steps:
- uses: actions/checkout@v4
- name: Install Dependencies
run: shards install
env:
SHARDS_OVERRIDE: shard.dev.yml
- name: Ameba
run: ./bin/ameba
test_compiled:
strategy:
fail-fast: false
matrix:
crystal:
- latest
- nightly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install kcov
if: matrix.crystal == 'nightly'
run: |
sudo apt-get update &&
sudo apt-get install binutils-dev libssl-dev libcurl4-openssl-dev libelf-dev libstdc++-12-dev zlib1g-dev libdw-dev libiberty-dev
curl -L -o ./kcov.tar.gz https://github.com/SimonKagstrom/kcov/archive/refs/tags/v43.tar.gz &&
mkdir kcov-source &&
tar xzf kcov.tar.gz -C kcov-source --strip-components=1 &&
cd kcov-source &&
mkdir build &&
cd build &&
cmake .. &&
make -j$(nproc) &&
sudo make install
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
with:
crystal: ${{ matrix.crystal }}
- name: Install Dependencies
run: shards install --skip-postinstall --skip-executables
env:
SHARDS_OVERRIDE: shard.dev.yml
- name: Compiled Specs
run: ./scripts/test.sh all compiled
shell: bash
- uses: codecov/codecov-action@v5
if: matrix.crystal == 'nightly' && github.event_name != 'schedule' # Only want to upload coverage report once in the matrix
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
directory: coverage
files: '**/cov.xml' # There is no `unreachable.codecov.json` file when running _only_ compiled specs
flags: compiled
verbose: true
- uses: codecov/test-results-action@v1
if: matrix.crystal == 'nightly' && github.event_name != 'schedule' # Only want to upload coverage report once in the matrix
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
directory: coverage
files: '**/junit.xml'
flags: compiled
verbose: true
test_unit:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
crystal:
- latest
- nightly
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
if: github.event_name != 'pull_request'
- uses: actions/checkout@v4
if: github.event_name == 'pull_request'
with:
fetch-depth: 0
- name: Install kcov
if: matrix.os == 'ubuntu-latest' && matrix.crystal == 'nightly'
run: |
sudo apt-get update &&
sudo apt-get install binutils-dev libssl-dev libcurl4-openssl-dev libelf-dev libstdc++-12-dev zlib1g-dev libdw-dev libiberty-dev
curl -L -o ./kcov.tar.gz https://github.com/SimonKagstrom/kcov/archive/refs/tags/v43.tar.gz &&
mkdir kcov-source &&
tar xzf kcov.tar.gz -C kcov-source --strip-components=1 &&
cd kcov-source &&
mkdir build &&
cd build &&
cmake .. &&
make -j$(nproc) &&
sudo make install
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
with:
crystal: ${{ matrix.crystal }}
- name: Install Dependencies
run: shards install --skip-postinstall --skip-executables
env:
SHARDS_OVERRIDE: shard.dev.yml
- name: Specs
run: ./scripts/test.sh all unit
shell: bash
- uses: codecov/codecov-action@v5
if: matrix.os == 'ubuntu-latest' && matrix.crystal == 'nightly' && github.event_name != 'schedule' # Only want to upload coverage report once in the matrix
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
directory: coverage
files: '**/cov.xml,**/unreachable.codecov.json'
flags: unit
verbose: true
- uses: codecov/test-results-action@v1
if: matrix.os == 'ubuntu-latest' && matrix.crystal == 'nightly' && github.event_name != 'schedule' # Only want to upload coverage report once in the matrix
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
directory: coverage
files: '**/junit.xml'
flags: unit
verbose: true