-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (82 loc) · 2.68 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: hyperfiddle/hfql
on:
push:
branches:
- "**"
pull_request:
jobs:
jvm:
name: JVM tests
runs-on: [ubuntu-latest]
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- run: git status
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/deps.edn') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Install clojure tools
uses: DeLaGuardo/[email protected]
with:
cli: 1.11.1.1113
- name: Run tests
run: clojure -X:test-jvm
browser:
name: Browser tests
runs-on: [ubuntu-latest]
timeout-minutes: 5
steps:
- uses: actions/checkout@v3
- run: git status
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/deps.edn') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: NPM install
run: npm install --include=dev
# Install chrome and dependencies, puppeteer fails otherwise
- run: sudo apt-get update && sudo apt-get install -y wget gnupg
- run: wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
- run: sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
- run: sudo apt-get update && sudo apt-get install -y google-chrome-stable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst fonts-freefont-ttf libxss1 --no-install-recommends
# - run: rm -rf /var/lib/apt/lists/*
- name: Install clojure tools
uses: DeLaGuardo/[email protected]
with:
cli: 1.11.1.1113
- name: Compile tests
run: clojure -M:test-cljs compile browser-test --force-spawn
- name: Run tests
run: ./node_modules/.bin/karma start --single-run
deploy:
name: Deploy to Fly.io
needs: [jvm, browser]
if: success()
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: NO_COLOR=1 flyctl deploy --build-arg VERSION=$(git describe --tags --long --always --dirty) --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}