-
Notifications
You must be signed in to change notification settings - Fork 2
70 lines (59 loc) · 1.81 KB
/
ci.yml
File metadata and controls
70 lines (59 loc) · 1.81 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
name: CI
on:
push:
branches: [main, master]
pull_request:
workflow_dispatch:
jobs:
test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Setup Carp
uses: carpentry-org/setup-carp@v1
- name: Install SQLite deps (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libsqlite3-dev
- name: Install SQLite deps (macOS)
if: runner.os == 'macOS'
run: |
brew update
brew install sqlite
- name: Build example
run: |
set -euo pipefail
carp -b examples/simple.carp
- name: Install angler
run: |
set -euo pipefail
git clone --depth 1 https://github.com/carpentry-org/angler /tmp/angler
(cd /tmp/angler && carp -b main.carp)
sudo install -m 755 /tmp/angler/out/angler /usr/local/bin/
- name: Install carp-fmt
run: |
set -euo pipefail
git clone --depth 1 https://github.com/carpentry-org/carp-fmt /tmp/carp-fmt
(cd /tmp/carp-fmt && carp -b main.carp)
sudo install -m 755 /tmp/carp-fmt/out/carp-fmt /usr/local/bin/
- name: Lint
run: |
angler $(find . -name '*.carp' \
-not -path './out/*' \
-not -path './docs/*' \
-not -path './.carp-src/*' \
-not -path './examples/*')
- name: Format check
run: |
carp-fmt --check $(find . -name '*.carp' \
-not -path './out/*' \
-not -path './docs/*' \
-not -path './.carp-src/*' \
-not -path './examples/*')
- name: Generate docs
run: carp -x gendocs.carp