-
Notifications
You must be signed in to change notification settings - Fork 5
78 lines (63 loc) · 2.36 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
name: CI
on:
push:
branches: [master]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
# https://github.com/marketplace/actions/cache-apt-packages
- uses: actions/checkout@v4
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: protobuf-compiler
# https://github.com/purescript-contrib/setup-purescript/
- name: Set up a PureScript toolchain
uses: purescript-contrib/setup-purescript@main
with:
purescript: "unstable"
purs-tidy: "latest"
spago: "unstable"
# https://github.com/marketplace/actions/cache
- name: Cache PureScript dependencies
uses: actions/cache@v4
with:
key: ${{ runner.os }}-spago-${{ hashFiles('**/spago.lock') }}-2
path: |
./plugin/.spago
./conformance/.spago
- name: Install dependencies
run: |
protoc --version
echo -n "node "
node --version
echo -n "purs "
purs --version
echo -n "spago "
spago --version
echo ""
spago install
- name: Build Plugin
run: |
cd plugin
spago build
- name: Test Plugin
# Need --experimental_allow_proto3_optional until the CI protoc is upgraded
run: |
protoc --experimental_allow_proto3_optional --plugin=bin/protoc-gen-purescript --purescript_out=./plugin/test/Test/generated --proto_path ./plugin/test ./plugin/test/*.proto
cd plugin
spago test
# - name: Install test dependencies
# run: spago -x spago-test.dhall install
# - name: Build plugin
# run: spago -x spago-plugin.dhall build --no-install --purs-args '--censor-lib --strict --censor-codes='UserDefinedWarning''
# - run: mkdir -p ./test/generated
# - name: Generate test from .proto
# run: PATH=./bin:$PATH protoc --experimental_allow_proto3_optional --purescript_out=./test/generated test/*.proto
# - name: Build test
# run: spago -x spago-test.dhall build --no-install --purs-args '--censor-lib --censor-codes='UserDefinedWarning''
# - name: Run tests
# run: spago -x spago-test.dhall test --no-install
# We're not running the conformance test because the conformance
# test runner is a pretty heavy build.