-
Notifications
You must be signed in to change notification settings - Fork 902
81 lines (72 loc) · 2.31 KB
/
ci-main.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
name: "[CI] GTN Tutorial Linting"
concurrency:
group: ci-tutsli-${{ github.head_ref }}
cancel-in-progress: true
on:
pull_request:
paths:
- 'Gemfile.lock'
- 'topics/**'
- '**/tutorial*.md'
- '**/slides.html'
- '**/slides/*.html'
- 'learning-pathways/*'
- 'faqs/**'
- 'news/**'
- 'events/**'
- CONTRIBUTORS.yaml
- GRANTS.yaml
- ORGANISATIONS.yaml
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
persist-credentials: false
- uses: reviewdog/action-setup@v1
with:
reviewdog_version: latest
# BEGIN Dependencies
- uses: actions/setup-python@v5
with:
python-version: '3.11'
architecture: 'x64'
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2"
- uses: actions/cache@v4
with:
path: |
vendor/bundle
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}-
restore-keys: |
${{ runner.os }}-gems-
- name: Install dependencies
run: |
gem install bundler
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
pip install pyyaml
bundle pristine ffi
# END Dependencies
- name: Check Frontmatter
run: |
make check-diffs ACTIVATE_ENV=pwd
make check-frontmatter ACTIVATE_ENV=pwd
make check-contributors ACTIVATE_ENV=pwd
python bin/mergeyaml.py --nondocker > /dev/null
- name: Check Tutorial Formatting
run: |
find topics/ -name tutorial.md | xargs -n 1 python bin/check-broken-boxes.py | reviewdog -efm="%f:%l: %m" -filter-mode=file -reporter=github-pr-review -fail-level=any
bundle exec ruby bin/lint.rb --format rdjson | reviewdog -filter-mode=file -reporter=github-pr-review -f=rdjsonl -fail-level=any
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# - name: rubocop
# uses: reviewdog/action-rubocop@v2
# with:
# rubocop_version: gemfile
# reporter: github-pr-review
# rubocop_flags: --except Layout/LineLength,Lint/RedundantCopDisableDirective
# fail_on_error: true