-
-
Notifications
You must be signed in to change notification settings - Fork 29
157 lines (141 loc) · 4.78 KB
/
workflow.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
name: MMPM Build Pipeline
on:
push:
branches:
- "*"
tags:
- "*"
pull_request:
branches:
- "*"
release:
types: [created]
jobs:
mmpm-cli:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache Python Dependencies
uses: actions/cache@v3
with:
python-version: ${{ matrix.python-version }}
path: |
~/.cache/pip
${{ github.workspace }}/.venv
key: ${{ runner.os }}-python-deps-${{ hashFiles('**/pdm.lock') }}
restore-keys: |
${{ runner.os }}-python-deps-${{ hashFiles('**/pdm.lock') }}
- name: Python Dependencies
run: |
python -m pip install pdm
pdm install
- name: Python Tests
run: |
pdm run lint
pdm run mypy
pdm run test
pdm run report
- name: Python Build
run: |
pdm build
- name: Install Test
run: |
pdm install
options=("version" "--help" "completion --help" "db --help" "guided-setup --help" "install --help" "list --help" "logs --help" "mm-ctl --help" "mm-pkg --help" "open --help" "remove --help" "search --help" "show --help" "ui --help" "update --help" "upgrade --help" "version --help")
for option in "${options[@]}"; do ${{ github.workspace }}/.venv/bin/mmpm $option; done
mmpm-ui:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ["16.x", "18.x", "20.x", "22"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache Node Modules
uses: actions/cache@v3
with:
path: |
'./ui/node_modules'
key: ${{ runner.os }}-angular-deps-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-angular-deps-${{ hashFiles('**/package-lock.json') }}
- name: Cache Angular Build Artifacts
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/ui/build
key: ${{ runner.os }}-angular-build-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-angular-build-${{ hashFiles('**/package-lock.json') }}
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Angular Dependencies
run: |
cd ui && npm install --legacy-peer-deps && cd ..
- name: Angular Tests
run: |
cd ui && npm run lint && cd ..
- name: Angular Build
run: |
cd ui && ./node_modules/@angular/cli/bin/ng.js build --configuration production --output-hashing none --base-href / && cd ..
create-artifact:
needs: [mmpm-cli, mmpm-ui]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Restore Python Dependencies Cache
uses: actions/cache@v3
with:
path: |
~/.cache/pip
${{ github.workspace }}/.venv
key: ${{ runner.os }}-python-deps-${{ hashFiles('**/pdm.lock') }}
restore-keys: |
${{ runner.os }}-python-deps-${{ hashFiles('**/pdm.lock') }}
- name: Restore Angular Build Artifacts Cache
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/ui/build
key: ${{ runner.os }}-angular-build-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-angular-build-${{ hashFiles('**/package-lock.json') }}
- name: Package MMPM
run: |
python -m pip install pdm
pdm install
mkdir -p ${{ github.workspace }}/mmpm/ui
cp -r ${{ github.workspace }}/ui/build/* ${{ github.workspace }}/mmpm/ui
pdm build
- name: Cache MMPM Artifacts
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/dist
key: ${{ runner.os }}-python-build-${{ hashFiles('**/pdm.lock') }}
restore-keys: |
${{ runner.os }}-python-build-${{ hashFiles('**/pdm.lock') }}
- name: Publish to PyPi
if: startsWith(github.ref, 'refs/tags/')
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
skip_existing: true
verbose: true
- name: Publish Release
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v3
with:
name: python-package-distributions
path: ${{ github.workspace }}/dist/