-
-
Notifications
You must be signed in to change notification settings - Fork 6
99 lines (97 loc) · 2.81 KB
/
pr.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
98
99
name: Build & Test
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
linux:
name: Build (Linux)
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup asdf
uses: asdf-vm/actions/setup@v2
- name: Cache asdf
id: cache-asdf
uses: actions/cache@v3
with:
path: |
/home/runner/.asdf
key: ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}
restore-keys: |
${{ runner.os }}-asdf-
- name: Install dependencies in .tool-versions
uses: asdf-vm/actions/install@v2
- name: Install cross-compiler toolchain
run: sudo apt-get -y install gcc-aarch64-linux-gnu libxml2-dev:arm64 libxml2-dev
- name: Run build
run: just build-all --id linux
- uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: code
path: /home/runner/work/odict
darwin:
name: Build (Darwin)
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup asdf
uses: asdf-vm/actions/setup@v2
- name: Cache asdf
id: cache-asdf
uses: actions/cache@v3
with:
path: |
/home/runner/.asdf
key: ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}
restore-keys: |
${{ runner.os }}-asdf-
- name: Install dependencies in .tool-versions
uses: asdf-vm/actions/install@v2
- name: Run build
run: just build-all --id darwin
- uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: code
path: /home/runner/work/odict
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup asdf
uses: asdf-vm/actions/setup@v2
- name: Cache asdf
id: cache-asdf
uses: actions/cache@v3
with:
path: |
/home/runner/.asdf
key: ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}
restore-keys: |
${{ runner.os }}-asdf-
- name: Cache Poetry dependencies
uses: actions/cache@v3
with:
path: |
/home/runner/.venv
key: ${{ runner.os }}-poetry-${{ hashFiles('**/python/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Install dependencies in .tool-versions
uses: asdf-vm/actions/install@v2
- name: Run tests
env:
POETRY_VIRTUALENVS_IN_PROJECT: true
run: just test
- uses: actions/upload-artifact@v3
if: ${{ failure() }}
with:
name: code
path: /home/runner/work/odict