-
-
Notifications
You must be signed in to change notification settings - Fork 24
120 lines (104 loc) · 3.63 KB
/
ci.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
name: "CI"
env:
RATOS_CONFIGURATION_PATH: ${{ github.workspace }}/ratos-configuration
KLIPPER_CONFIG_PATH: ${{ github.workspace }}/config
RATOS_SCRIPT_DIR: ${{ github.workspace }}/ratos-configurator/src/scripts
KLIPPER_DIR: ${{ github.workspace }}/klipper
KLIPPER_ENV: ${{ github.workspace }}/klippy-env
MOONRAKER_DIR: ${{ github.workspace }}/moonraker
LOG_FILE: ${{ github.workspace }}/ratos-configurator.log
RATOS_DATA_DIR: ${{ github.workspace }}/ratos-data
on:
push:
branches:
- "development"
pull_request:
branches:
- "**"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
cancel-in-progress: true
jobs:
checkout_dependencies:
name: Lint, Typecheck and Tests
runs-on: ubuntu-latest
outputs:
STORE_PATH: ${{ steps.generate-keys.outputs.STORE_PATH }}
CACHE_KEY: ${{ steps.generate-keys.outputs.STORE_PATH }}
bin_dest: ${{ steps.pnpm-install.outputs.bin_dest }}
dest: ${{ steps.pnpm-install.outputs.dest }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: Rat-OS/RatOS-configurator
path: "ratos-configurator"
- name: Install Node
uses: actions/[email protected]
with:
# Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0.
node-version: 18.x
- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 8
run_install: false
- name: Generate keys
id: generate-keys
shell: bash
env:
cache_key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml', '**/.git/refs/heads/*') }}
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
echo "CACHE_KEY=$cache_key" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: pnpm cache
id: cache
with:
path: |
${{ steps.generate-keys.outputs.STORE_PATH }}
key: ${{ steps.generate-keys.outputs.CACHE_KEY }}
- name: Dependencies
working-directory: ratos-configurator/src
run: pnpm install --frozen-lockfile
- name: Checkout RatOS Configuration
uses: actions/checkout@v4
with:
repository: Rat-OS/RatOS-configuration
path: "ratos-configuration"
ref: ${{ github.ref_name }}
- name: Checkout Klipper
uses: actions/checkout@v4
with:
repository: klipper3d/klipper
path: "klipper"
- name: Checkout Moonraker
uses: actions/checkout@v4
with:
repository: Arksine/moonraker
path: "moonraker"
- name: Lint
working-directory: ratos-configurator/src
run: pnpm run lint:ci
- name: Typecheck
uses: fersilva16/[email protected]
if: success() || failure() # run this step even if previous step failed
with:
project: ratos-configurator/src/tsconfig.json
- name: Run test suite
working-directory: ratos-configurator/src
if: success() || failure() # run this step even if previous step failed
run: pnpm run test:ci --outputFile=./report.xml
- name: Upload reports
uses: actions/upload-artifact@v3 # upload test results
if: success() || failure() # run this step even if previous step failed
with:
name: test-results
path: |
ratos-configurator/src/report.xml
ratos-configurator/src/eslint_report.json
- name: Report status
if: ${{ failure() }}
run: exit 1