-
Notifications
You must be signed in to change notification settings - Fork 18
134 lines (114 loc) · 3.99 KB
/
project-creation.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
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
# Copyright (c) 2023-2024 Contributors to the Eclipse Foundation
#
# This program and the accompanying materials are made available under the
# terms of the Apache License, Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
# SPDX-License-Identifier: Apache-2.0
name: Project creation
concurrency:
group: ${{ github.ref }}-project-creation
cancel-in-progress: true
on:
workflow_dispatch:
push:
# Run only on branches/commits and not tags
branches:
- main
pull_request:
branches:
- main
# Scheduled build to fetch regressions, if any
schedule:
- cron: "0 4 * * *"
jobs:
check-project-creation:
name: Check project creation
runs-on: ubuntu-22.04
strategy:
matrix:
example: ["no-example", "seat-adjuster"]
fail-fast: false
steps:
- uses: actions/setup-node@v4
with:
node-version: 18
- name: Checkout CLI
uses: actions/checkout@v4
with:
repository: eclipse-velocitas/cli
path: cli
ref: v0.11.0
- name: Checkout SDK repo
uses: actions/checkout@v4
with:
path: sdk
- name: Install CLI
shell: bash
run: |
cd cli
npm i && npm run build && npx oclif manifest && npm i -g .
- name: Checkout vehicle-app-template
uses: actions/checkout@v4
with:
repository: eclipse-velocitas/vehicle-app-template
path: vehicle-app-template
ref: main
- name: Create project
shell: bash
run: |
git config --global user.name "Git User"
git config --global user.email "gituser@email.com"
# overwrite SDK path in order to use scripts from this branch (rather than sdk/main)
export VELOCITAS_SDK_PATH_OVERRIDE=$(pwd)/sdk
mkdir app
cd app
# show available commands and version of CLI
velocitas
# copy "full" package-index.json from CLI repo
cp ../vehicle-app-template/package-index.json ./package-index.json
CREATE_ARGS="-n MyApp"
if [ "${{ matrix.example }}" != "no-example" ]; then
CREATE_ARGS="-e ${{ matrix.example }}"
fi
velocitas create -c vapp-core-python $CREATE_ARGS
# Velocitas CLI fetches an older merged/released version of the example
# But we want to check the one in this repository so lets copy it
if [ "${{ matrix.example }}" != "no-example" ]; then
cp -r ../sdk/examples/${{ matrix.example }}/* ../app/app
fi
- name: Install dependencies
shell: bash
run: |
pip install -r ./sdk/.project-creation/test/requirements.txt
- name: Run verification on generated project
shell: bash
run: |
export VELOCITAS_SDK_ROOT=./sdk
export VELOCITAS_APP_ROOT=./app
# debug print contents
ls -al $VELOCITAS_APP_ROOT
pytest --ignore-glob=**/.devcontainer/* --ignore-glob=**/.skeleton/* ./sdk/.project-creation
- name: Check if devContainer starts up properly and app is usable
uses: devcontainers/ci@v0.3
with:
subFolder: ./app
runCmd: |
git init && \
pre-commit run --all-files && \
pip3 install -r .devcontainer/tests/automated_tests/requirements.txt && \
cat app/AppManifest.json && \
pytest -sx .devcontainer/tests/automated_tests
- name: Upload logs
uses: actions/upload-artifact@v4
if: always()
with:
name: logs_${{ matrix.example }}
path: ./app/logs
retention-days: 1