-
-
Notifications
You must be signed in to change notification settings - Fork 8
71 lines (69 loc) · 2.22 KB
/
test.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
name: Test
on: push
jobs:
test:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Configure Node caching
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: actions/cache@v4
name: Configure pip caching
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Node dependencies
run: npm install
- name: Download standalone Python
run: |
./download-python.sh
- name: Run tests
id: firstTest
run: npm test
timeout-minutes: 5
continue-on-error: true
- name: Retry tests once if they fail
if: steps.firstTest.outcome == 'failure'
run: npm test
timeout-minutes: 5
- name: Upload test videos
uses: actions/upload-artifact@v3
with:
name: test-videos
path: test-videos/
- name: Build distribution
if: github.ref == 'refs/heads/main'
env:
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
CSC_LINK: ${{ secrets.CSC_LINK }}
APPLEID: ${{ secrets.APPLEID }}
APPLEIDPASS: ${{ secrets.APPLEIDPASS }}
run: npm run dist
- name: Create zip file
if: github.ref == 'refs/heads/main'
run: |
cd dist/mac
ditto -c -k --keepParent Datasette.app Datasette.app.zip
- name: And a README (to work around GitHub double-zips)
if: github.ref == 'refs/heads/main'
run: |
echo "More information: https://datasette.io" > dist/mac/README.txt
- name: Upload artifact
if: github.ref == 'refs/heads/main'
uses: actions/upload-artifact@v4
with:
name: Datasette-macOS
path: |
dist/mac/Datasette.app.zip
dist/mac/README.txt