summaryrefslogtreecommitdiff
path: root/.github/workflows/lv_sim.yml
blob: 951b3c8d301d28d9b8b505622d7eec5f6cb5ba54 (plain)
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
# GitHub Actions Workflow to build Simulator for PineTime Smart Watch LVGL Interface

name: Build PineTime LVGL Simulator

on:
  push:
    branches: [ master, develop ]
    paths-ignore:
      - 'doc/**'
      - 'images/**'
  pull_request:
    branches: [ develop ]
    paths-ignore:
      - 'doc/**'
      - 'images/**'
  # Allows you to run this workflow manually from the Actions tab
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest

    steps:

      #########################################################################################
      # Download and Install Dependencies

      - name: Install cmake
        uses: lukka/get-cmake@v3.18.3

      - name: Install SDL2 development package
        run:  |
          sudo apt-get update
          sudo apt-get -y install libsdl2-dev

      - name: Install lv_font_conv
        run:
          npm i -g lv_font_conv@1.5.2

      #########################################################################################
      # Checkout

      - name: Checkout source files
        uses: actions/checkout@v2
        with:
          submodules: recursive

      #########################################################################################
      # get InfiniSim repo

      - name: Get InfiniSim repo
        run:  |
          git clone https://github.com/InfiniTimeOrg/InfiniSim.git --depth 1 --branch main
          git -C InfiniSim submodule update --init lv_drivers libpng

      #########################################################################################
      # CMake

      - name: CMake
        run:  |
          cmake -G Ninja -S InfiniSim -B build_lv_sim -DInfiniTime_DIR="${PWD}"

      #########################################################################################
      # Build and Upload simulator

      - name: Build simulator executable
        run:  |
          cmake --build build_lv_sim

      - name: Upload simulator executable
        uses: actions/upload-artifact@v3
        with:
          name: infinisim-${{ github.head_ref }}
          path: build_lv_sim/infinisim