-
Notifications
You must be signed in to change notification settings - Fork 0
74 lines (61 loc) · 2 KB
/
run-tests.yaml
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
name: Run tests
on:
# Run when a release is published
# release:
# types:
# - published
# Allow for manual trigger for now
workflow_dispatch:
jobs:
tests:
name: Run tests
runs-on: ubuntu-latest
outputs:
actualResult: ${{ steps.test-run.outcome }}
steps:
- name: Check out the repository
uses: actions/checkout@v4
- name: Install Roc
uses: hasnep/setup-roc@main
with:
roc-version: nightly
# TODO this could work if roc could generate a hash of all used dependencies
# # Restore cached roc packages
# - name: Restore roc packages
# uses: actions/cache@v3
# with:
# path: /home/runner/.cache/roc/packages
# key: "roc-packages"
- name: Build Roc app
run: roc build tests.roc
# Get the browser version - it will be used as a cache key to store downloaded browser and driver
- name: Generate browser files cache key
id: cache-key
run: |
key=$(./tests --print-browser-version-only)
echo "Cache key: $key"
echo "key=$key" >> $GITHUB_OUTPUT
# Restore cached browser and driver data using the save browser version as a key
- name: Restore browser files cache
uses: actions/cache@v4
with:
path: ./browser_files
key: ${{ steps.cache-key.outputs.key }}
# Setup browser and driver - setup will be skiped if browser files exist
- name: Setup browser and driver
run: ./tests --setup
# Run tests
- name: Run roc tests
id: test-run
# continue-on-error: true
run: ./tests --headless
- name: Upload docs artifact
uses: actions/upload-artifact@v4
if: always()
with:
name: results
path: testResults/
# Fail the job then the test run failed
- name: Check test results
if: steps.test-run.outcome != "success"
run: exit 1