-
Notifications
You must be signed in to change notification settings - Fork 5
107 lines (100 loc) · 3.1 KB
/
ci.yaml
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
---
name: ci
"on":
push:
branches:
- 'main'
pull_request:
jobs:
rendering:
runs-on: ubuntu-22.04
strategy:
matrix:
cookiecutter_directory:
- rust/repo
- rust/workspace-crate
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- uses: abatilo/actions-poetry@v2
- run: sudo apt-get install -y rdfind symlinks patchutils
- run: ./generate-examples.sh ${{ matrix.cookiecutter_directory }}
- name: Ensure there are no unaccounted for changes
run: |-
set +e
git diff --quiet --ignore-submodules HEAD
RESULT=$?
set -e
if [[ $RESULT != 0 ]]; then
echo "Please run generate-examples.sh to update examples." 1>&2
git diff --ignore-submodules HEAD
fi
exit $RESULT
mac-rendering:
runs-on: macos-latest
needs:
- rendering
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- uses: abatilo/actions-poetry@v2
- run: brew install rdfind symlinks
- run: ./generate-examples.sh rust/repo
- name: Ensure there are no unaccounted for changes
run: |-
set +e
git diff --quiet --ignore-submodules HEAD
RESULT=$?
set -e
if [[ $RESULT != 0 ]]; then
echo "Mac example generation differs from linux veresion" 1>&2
git diff --ignore-submodules HEAD
fi
exit $RESULT
lint:
runs-on: ubuntu-latest
needs:
- rendering
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: xt0rted/markdownlint-problem-matcher@v2
- uses: DavidAnson/markdownlint-cli2-action@v10
with:
globs: "**/*.md"
# FIXME: Add yamllint problem matcher
- run: yamllint -s .github */*/examples
notify:
runs-on: ubuntu-latest
if: github.event_name == 'push' && failure()
needs:
- lint
- rendering
steps:
- name: Notify Discord on failure
uses: sarisia/actions-status-discord@v1
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
username: "Github Actions"
status: Failure
color: 0xff0000
nodetail: true
# yamllint disable rule:line-length
title: "${{ github.repository }} ${{ github.workflow }} has failed on ${{ github.event_name }} to ${{ github.ref_name }}"
url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
description: >
[`@${{ github.actor }}`](${{ github.server_url }}/${{ github.actor }})
was the last one to touch
[that repository](${{ github.server_url }}/${{ github.repository }}),
is all I'm saying.
avatar_url: "https://media0.giphy.com/media/oe33xf3B50fsc/200.gif"
# yamllint enable rule:line-length