Skip to content

Setup workflow dependencies #6

Setup workflow dependencies

Setup workflow dependencies #6

Workflow file for this run

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: Checkout RatOS Configurator
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
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: get pnpm store
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: pnpm cache
with:
path: |
${{ steps.pnpm-cache.outputs.STORE_PATH }}
'ratos-configuration'
'klipper'
'moonraker'
'**/node_modules'
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- 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"
- 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"
lint:
name: Lint
needs: [checkout_dependencies]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
repository: Rat-OS/RatOS-configurator
path: "ratos-configurator"
- uses: actions/cache@v3
name: Restore Cache
with:
path: |
${{ needs.checkout_dependencies.outputs.STORE_PATH }}
'**/node_modules'
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Begin CI...
working-directory: ratos-configurator/src
run: pnpm run lint:ci
typecheck:
needs: [checkout_dependencies]
name: Typecheck
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
repository: Rat-OS/RatOS-configurator
path: "ratos-configurator"
- uses: actions/cache@v3
name: Restore Cache
with:
path: |
${{ needs.checkout_dependencies.outputs.STORE_PATH }}
'**/node_modules'
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Begin CI...
uses: fersilva16/[email protected]
with:
project: ratos-configurator/src/tsconfig.json
test:
name: Test
runs-on: ubuntu-latest
needs: [checkout_dependencies]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
repository: Rat-OS/RatOS-configurator
path: "ratos-configurator"
- uses: actions/cache@v3
name: Restore Cache
with:
path: |
${{ needs.checkout_dependencies.outputs.STORE_PATH }}
'**/node_modules'
'ratos-configuration'
'klipper'
'moonraker'
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Begin CI...
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