-
Notifications
You must be signed in to change notification settings - Fork 15
136 lines (125 loc) · 3.88 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
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
schedule:
- cron: "0 6 * * 1"
env:
PARALLEL_TESTS: 10
PARALLEL_BUILDS: 2
jobs:
docs:
if: false # Temporarily disable as docs just _do not work_ for a driver
name: "Crystal Docs"
runs-on: ubuntu-latest
continue-on-error: true
container: crystallang/crystal
steps:
- uses: actions/checkout@v4
- name: Install Shards
run: shards install --ignore-crystal-version
- name: Docs
run: crystal docs
style:
name: "Style"
uses: PlaceOS/.github/.github/workflows/crystal-style.yml@main
subset-report:
name: "Subset Report - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }}"
runs-on: ubuntu-latest
continue-on-error: ${{ !matrix.stable }}
strategy:
fail-fast: false
matrix:
stable: [true]
crystal:
- latest
include:
- stable: false
crystal: nightly
steps:
- id: changes
uses: trilom/[email protected]
with:
output: ' '
- uses: actions/checkout@v4
- name: Cache shards
uses: actions/cache@v3
with:
path: lib
key: ${{ hashFiles('shard.lock') }}
- name: Driver Report
# Skip subset report if dependencies have changed
if: ${{ !contains(steps.changes.outputs.files, 'shard.yml') && !contains(steps.changes.outputs.files, 'shard.lock') }}
run: |
./harness \
report \
--verbose \
--tests=${{ env.PARALLEL_TESTS }} \
--builds=${{ env.PARALLEL_BUILDS }} \
${{ steps.changes.outputs.files }}
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_REGION: ${{ secrets.AWS_REGION }}
BUILD_SERVICE_DISABLED: true
CRYSTAL_VERSION: ${{ matrix.crystal }}
- name: Upload failure logs
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: logs-${{ matrix.crystal }}-${{ github.sha }}
path: .logs/*.log
full-report:
name: "Full Report - crystal: ${{ matrix.crystal }}, stable: ${{ matrix.stable }}"
needs: subset-report
runs-on: ubuntu-latest
continue-on-error: ${{ !matrix.stable }}
strategy:
fail-fast: false
matrix:
stable: [true]
crystal:
- latest
include:
- stable: false
crystal: nightly
steps:
- uses: actions/checkout@v4
- name: Cache shards
uses: actions/cache@v3
with:
path: lib
key: ${{ hashFiles('shard.lock') }}
# Binary Cache Logic
#############################################################################################
- uses: actions/cache@v3
with:
path: binaries
key: drivers-${{ env.CRYSTAL_VERSION }}-${{ github.run_id }}
restore-keys: drivers-${{ env.CRYSTAL_VERSION }}-
#############################################################################################
- name: Driver Report
run: |
./harness \
report \
--verbose \
--tests=${{ env.PARALLEL_TESTS }} \
--builds=${{ env.PARALLEL_BUILDS }}
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_REGION: ${{ secrets.AWS_REGION }}
BUILD_SERVICE_DISABLED: false
CRYSTAL_VERSION: ${{ matrix.crystal }}
- name: Show build container logs
if: ${{ failure() }}
run: docker compose logs build
- name: Show drivers container logs
if: ${{ failure() }}
run: docker compose logs drivers
- name: Upload failure logs
if: ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: logs-${{ matrix.crystal }}-${{ github.sha }}
path: .logs/*.log