-
Notifications
You must be signed in to change notification settings - Fork 7
73 lines (58 loc) · 1.65 KB
/
tests.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
# Lifted from github.com/squint-cljs/cherry
name: Tests
on: [push, pull_request]
env:
SECRET: testing
TESTING: 1
DATABASE_URL: sqlite://./tests.sqlite
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macOS-latest] # windows-latest
version: [16, 18, 20]
runs-on: ${{ matrix.os }}
steps:
- name: "Checkout code"
uses: actions/checkout@v4
- name: Set up node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.version }}
- name: Prepare java
uses: actions/setup-java@v4
with:
distribution: "adopt"
java-version: 11
- name: Setup Clojure
uses: DeLaGuardo/setup-clojure@9.5
with:
cli: 1.10.3.1040
- name: Cache clojure dependencies
uses: actions/cache@v4
with:
path: |
~/.m2/repository
~/.gitlibs
~/.deps.clj
# List all files containing dependencies:
key: cljdeps-${{ hashFiles('shadow-cljs.edn') }}
# key: cljdeps-${{ hashFiles('deps.edn', 'bb.edn') }}
# key: cljdeps-${{ hashFiles('project.clj') }}
# key: cljdeps-${{ hashFiles('build.boot') }}
restore-keys: cljdeps-
- name: Install Node deps
run: npm i
- name: Run the tests
run: npm run test
- name: Run the e2e tests
run: npm run test-e2e
- name: Set up PostgreSQL
run: |
sudo apt install postgresql libpq-dev
sudo service postgresql start
sudo -u postgres createuser --superuser "$USER"
if: runner.os == 'Linux'
- name: Run the tests on Postgres
run: npm run test-postgres
if: runner.os == 'Linux'