InfiniTime/.github/workflows/main.yml

95 lines
2.9 KiB
YAML
Raw Normal View History

2022-08-25 05:32:46 +00:00
name: CI
2022-08-25 05:32:46 +00:00
# Run this workflow whenever the build may be affected
on:
push:
branches: [ master, develop ]
paths-ignore:
- 'doc/**'
2022-08-10 23:42:17 +00:00
- '**.md'
pull_request:
branches: [ develop ]
paths-ignore:
- 'doc/**'
2022-08-10 23:42:17 +00:00
- '**.md'
jobs:
2022-08-25 05:32:46 +00:00
build-firmware:
runs-on: ubuntu-latest
container:
image: infinitime/infinitime-build
steps:
# This workaround fixes the error "unsafe repository (REPO is owned by someone else)".
# See https://github.com/actions/checkout/issues/760 and https://github.com/actions/checkout/issues/766
# The fix in "actions/checkout@v2" was not sufficient as the build process also uses git (to get the current
# commit hash, for example).
- name: Workaround permission issues
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Checkout source files
uses: actions/checkout@v2
2021-08-14 12:47:00 +00:00
with:
submodules: recursive
- name: Build
shell: bash
env:
SOURCES_DIR: .
2022-05-27 08:36:55 +00:00
run: /opt/build.sh all
# Unzip the package because Upload Artifact will zip up the files
- name: Unzip DFU package
run: unzip ./build/output/pinetime-mcuboot-app-dfu-*.zip -d ./build/output/pinetime-mcuboot-app-dfu
- name: Upload DFU artifacts
uses: actions/upload-artifact@v3
with:
name: InfiniTime DFU ${{ github.head_ref }}
path: ./build/output/pinetime-mcuboot-app-dfu/*
- name: Upload MCUBoot image artifacts
uses: actions/upload-artifact@v3
with:
name: InfiniTime MCUBoot image ${{ github.head_ref }}
2022-05-27 08:36:55 +00:00
path: ./build/output/pinetime-mcuboot-app-image-*.bin
- name: Upload resources artifacts
uses: actions/upload-artifact@v3
with:
name: InfiniTime resources ${{ github.head_ref }}
path: ./build/output/infinitime-resources-*.zip
2022-08-25 05:32:46 +00:00
build-simulator:
runs-on: ubuntu-latest
steps:
- 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
- name: Checkout source files
uses: actions/checkout@v2
with:
submodules: recursive
- 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
- name: CMake
run: |
cmake -G Ninja -S InfiniSim -B build_lv_sim -DInfiniTime_DIR="${PWD}"
- 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