-
Notifications
You must be signed in to change notification settings - Fork 30
103 lines (85 loc) · 2.83 KB
/
init.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
100
101
102
103
name: Init
on:
workflow_call:
jobs:
init_ubuntu20:
runs-on: ubuntu-20.04
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Cache venv
id: venv_ubuntu20
uses: actions/cache@v3
with:
path: .venv
key: venv_ubuntu20_${{ hashFiles('pdm.lock') }}
- name: Set up Python 3.6
if: steps.venv_ubuntu20.outputs.cache-hit != 'true'
uses: actions/setup-python@v4
with:
python-version: '3.6'
- name: Set up venv
if: steps.venv_ubuntu20.outputs.cache-hit != 'true'
run: |
python3.6 -m venv ".venv"
source .venv/bin/activate
pip install tox
init_ubuntu22:
runs-on: ubuntu-22.04
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Cache venv
id: venv_ubuntu22
uses: actions/cache@v3
with:
path: .venv
key: venv_ubuntu22_${{ hashFiles('pdm.lock') }}
- name: Set up venv
if: steps.venv_ubuntu22.outputs.cache-hit != 'true'
run: |
python3.10 -m venv ".venv"
source .venv/bin/activate
pip install pdm==2.8.0
pdm install
- name: Cache node modules
id: node_modules_ubuntu22
uses: actions/cache@v3
with:
path: node_modules
key: node_modules_ubuntu22_${{ hashFiles('package-lock.json') }}
- name: Set up node modules
if: steps.node_modules_ubuntu22.outputs.cache-hit != 'true'
run: |
source .venv/bin/activate
npm install
init_pkg:
runs-on: ubuntu-22.04
needs: init_ubuntu22
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Cache venv
uses: actions/cache@v3
with:
path: .venv
key: venv_ubuntu22_${{ hashFiles('pdm.lock') }}
- name: Deploy package
run: |
source .venv/bin/activate
pdm run deploy
- name: Build package
run: |
source .venv/bin/activate
pdm run build
- name: Cache package
uses: actions/cache@v3
with:
path: dist/
key: package_${{ github.run_id }}