-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (95 loc) · 2.95 KB
/
Copy pathci.yml
File metadata and controls
116 lines (95 loc) · 2.95 KB
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
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
jobs:
build:
name: Build & Format Check
runs-on: ubuntu-latest
outputs:
otp-version: ${{ steps.setup-env.outputs.otp-version }}
elixir-version: ${{ steps.setup-env.outputs.elixir-version }}
steps:
- uses: actions/checkout@v5
- id: setup-env
uses: ./.github/actions/setup-elixir-rust
- name: Check Elixir formatting
run: mix format --check-formatted
- name: Check Rust formatting
run: cd native/dprint_markdown_formatter && cargo fmt --check
- name: Compile with warnings as errors
run: mix compile --warnings-as-errors
- name: Run Rust clippy
run: cd native/dprint_markdown_formatter && cargo clippy -- -D warnings
test:
name: Run Tests
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-elixir-rust
- name: Run tests
run: mix test
quality:
name: Quality Checks
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
check: [credo, dialyzer]
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-elixir-rust
with:
cache-key-suffix: -${{ matrix.check }}
- name: Cache Dialyzer PLTs
if: matrix.check == 'dialyzer'
uses: actions/cache@v5
with:
path: priv/plts
key: ${{ runner.os }}-plt-${{ needs.build.outputs.otp-version }}-${{ needs.build.outputs.elixir-version }}-${{ hashFiles('**/mix.lock') }}
restore-keys: |
${{ runner.os }}-plt-${{ needs.build.outputs.otp-version }}-${{ needs.build.outputs.elixir-version }}
- name: Run Credo
if: matrix.check == 'credo'
run: mix credo --strict
- name: Run Dialyzer
if: matrix.check == 'dialyzer'
run: mix dialyzer --format github
matrix-test:
name: Test Matrix (Elixir ${{ matrix.elixir }}, OTP ${{ matrix.otp }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- elixir: "1.18.3"
otp: "27.2"
warnings_as_errors: true
- elixir: "1.17.3"
otp: "27.2"
- elixir: "1.17.3"
otp: "26.2"
- elixir: "1.16.3"
otp: "26.2"
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup-elixir-rust
with:
elixir-version: ${{ matrix.elixir }}
otp-version: ${{ matrix.otp }}
cache-key-suffix: -${{ matrix.otp }}-${{ matrix.elixir }}
- name: Compile
run: mix compile
- name: Compile with warnings as errors
if: ${{ matrix.warnings_as_errors == true }}
run: mix compile --warnings-as-errors --force
- name: Run tests
run: mix test