Skip to content

Commit

Permalink
Merge branch 'develop' into dice
Browse files Browse the repository at this point in the history
  • Loading branch information
Riksu9000 authored Jan 31, 2023
2 parents 159e73c + 81bc16f commit 4d37e1c
Show file tree
Hide file tree
Showing 119 changed files with 956 additions and 893 deletions.
8 changes: 2 additions & 6 deletions .github/ISSUE_TEMPLATE/bug-report.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
name: Bug Report
description: File a bug report
description: Something is broken
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
**Thanks for taking the time to fill out this bug report!**
*Please, before opening a bug report, check if similar issues already exist. In that case, use those issues to provide your feedback instead.*
- type: checkboxes
attributes:
label: Verification
description: Before submitting a bug report, check if similar issues already exist and use those issues to provide your feedback instead.
options:
- label: I searched for similar bug reports and found none was relevant.
required: true
Expand Down
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
blank_issues_enabled: true
contact_links:
- name: Feature request
url: https://github.com/InfiniTimeOrg/InfiniTime/discussions/categories/ideas
about: Request a feature or share your ideas
- name: PineTime community chat (Matrix)
url: https://app.element.io/#/room/#pinetime:matrix.org
about: Please ask questions about PineTime here.
Expand Down
41 changes: 0 additions & 41 deletions .github/ISSUE_TEMPLATE/feature-request.yaml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/ISSUE_TEMPLATE/issue-report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Issue report
description: Something's not good enough
body:
- type: checkboxes
attributes:
label: Verification
description: Before submitting an issue, check if similar issues already exist and use those issues to provide your feedback instead.
options:
- label: I searched for similar issues and found none was relevant.
required: true
- type: textarea
attributes:
label: Introduce the issue
description: Explain why it is an issue if necessary.
validations:
required: true
- type: textarea
attributes:
label: Preferred solution
description: You can suggest a solution to the issue here.
placeholder: Optional
- type: input
attributes:
label: Version
description: |
What [version of the firmware](https://github.com/JF002/InfiniTime/blob/develop/doc/gettingStarted/gettingStarted-1.0.md#how-to-check-the-version-of-infinitime-and-the-bootloader) are you running?
If you are running an older version, please consider [updating to the latest firmware](https://github.com/JF002/InfiniTime/blob/develop/doc/gettingStarted/gettingStarted-1.0.md#how-to-update-your-pinetime).
If you are running directly from git, specify the branch or the commit hash directly.
placeholder: Ex. v1.6.0 or develop or fc922b60
validations:
required: false
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
env:
USERNAME: infinitime
steps:
Expand Down
79 changes: 39 additions & 40 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:

jobs:
build-firmware:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
container:
image: infinitime/infinitime-build
outputs:
Expand Down Expand Up @@ -59,22 +59,23 @@ jobs:
path: ./build/output/infinitime-resources-*.zip

build-simulator:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Install cmake
uses: lukka/[email protected]

- name: Install SDL2 development package
run: |
sudo apt-get update
sudo apt-get -y install libsdl2-dev
- name: Install Ninja
run: |
sudo apt-get -y install ninja-build
- name: Install lv_font_conv
run:
npm i -g [email protected]

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

Expand Down Expand Up @@ -112,21 +113,27 @@ jobs:
# Override SOURCES_DIR in build.sh
SOURCES_DIR: .
steps:
- name: Cache sources
id: cache-sources
uses: actions/cache@v3
with:
path: .
key: source-files-${{ github.event.pull_request.base.sha }}

- if: ${{ steps.cache-sources.outputs.cache-hit != 'true' }}
name: Checkout source files
- name: Checkout current base branch files
uses: actions/checkout@v3
with:
ref: ${{ github.base_ref }}
submodules: recursive

- if: ${{ steps.cache-sources.outputs.cache-hit != 'true' }}
- name: Get base branch SHA
id: get-base-sha
run: |
# Fix for "detected dubious ownership in repository at '/__w/InfiniTime/InfiniTime'"
git config --global --add safe.directory /__w/InfiniTime/InfiniTime
echo base_sha=$(git rev-parse HEAD) >> $GITHUB_OUTPUT
- name: Cache build
id: cache-build
uses: actions/cache@v3
with:
path: ./build
key: build-files-${{ steps.get-base-sha.outputs.base_sha }}

- if: ${{ steps.cache-build.outputs.cache-hit != 'true' }}
name: Build
shell: bash
# Only pinetime-app target is needed, but post_build.sh fails
Expand All @@ -140,6 +147,7 @@ jobs:
compare-build-size:
if: github.event_name == 'pull_request'
name: 'Compare build size'
needs: [build-firmware, get-base-ref-size]
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -174,28 +182,19 @@ jobs:
echo "data_diff=$DATA_SIZE_DIFF" >> $GITHUB_OUTPUT
echo "bss_diff=$BSS_SIZE_DIFF" >> $GITHUB_OUTPUT
- name: Find Comment
# Due to a security concern, comments can only be created in the context of branches in the repo.
# PRs from forks can't get the comment.
if: github.event.pull_request.head.repo.full_name == github.repository
uses: peter-evans/find-comment@v2
id: build-size-comment
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: Build size and comparison to

- name: Create or update comment
if: github.event.pull_request.head.repo.full_name == github.repository
uses: peter-evans/create-or-update-comment@v2
- name: Write comment information to files
run: |
tee comment << EOF
Build size and comparison to ${{ github.base_ref }}:
| Section | Size | Difference |
| ------- | ---- | ---------- |
| text | ${{ needs.build-firmware.outputs.text_size }}B | ${{ steps.output-sizes-diff.outputs.text_diff }}B |
| data | ${{ needs.build-firmware.outputs.data_size }}B | ${{ steps.output-sizes-diff.outputs.data_diff }}B |
| bss | ${{ needs.build-firmware.outputs.bss_size }}B | ${{ steps.output-sizes-diff.outputs.bss_diff }}B |
EOF
- name: Upload comment
uses: actions/upload-artifact@v3
with:
comment-id: ${{ steps.build-size-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body: |
Build size and comparison to ${{ github.base_ref }}:
| Section | Size | Difference |
| ------- | ---- | ---------- |
| text | ${{ needs.build-firmware.outputs.text_size }}B | ${{ steps.output-sizes-diff.outputs.text_diff }}B |
| data | ${{ needs.build-firmware.outputs.data_size }}B | ${{ steps.output-sizes-diff.outputs.data_diff }}B |
| bss | ${{ needs.build-firmware.outputs.bss_size }}B | ${{ steps.output-sizes-diff.outputs.bss_diff }}B |
edit-mode: replace
name: comment
path: comment
50 changes: 50 additions & 0 deletions .github/workflows/pr-comment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# THIS WORKFLOW HAS WRITE PERMISSIONS TO THE REPO.
# MAKE SURE IT NEVER RUNS ANY CODE FROM THE FORK

name: PR comment

on:
pull_request_target:
branches: [ develop ]
paths-ignore:
- 'doc/**'
- '**.md'

jobs:
comment:
runs-on: ubuntu-latest
steps:
- name: Wait for builds to finish
id: wait-for-build
uses: fountainhead/action-wait-for-check@297be350cf8393728ea4d4b39435c7d7ae167c93
with:
checkName: 'Compare build size'
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.event.pull_request.head.sha }}

- if: steps.wait-for-build.outputs.conclusion != 'success'
run: exit 1

- name: Download artifact
uses: dawidd6/action-download-artifact@bd10f381a96414ce2b13a11bfa89902ba7cea07f
with:
workflow: main.yml
workflow_conclusion:
pr: ${{ github.event.pull_request.number }}
name: comment

- name: Find Comment
id: find-comment
uses: peter-evans/find-comment@81e2da3af01c92f83cb927cf3ace0e085617c556
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: Build size and comparison to

- name: Create or update comment
uses: peter-evans/create-or-update-comment@5adcb0bb0f9fb3f95ef05400558bdb3f329ee808
with:
comment-id: ${{ steps.find-comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
body-file: comment
edit-mode: replace
9 changes: 0 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ if (NOT NRF5_SDK_PATH)
message(FATAL_ERROR "The path to the NRF52 SDK must be specified on the command line (add -DNRF5_SDK_PATH=<path>")
endif ()

if(DEFINED USE_DEBUG_PINS AND USE_DEBUG_PINS)
add_definitions(-DUSE_DEBUG_PINS)
endif()

if(BUILD_DFU)
set(BUILD_DFU true)
endif()
Expand Down Expand Up @@ -59,11 +55,6 @@ message(" * Toolchain : " ${ARM_NONE_EABI_TOOLCHAIN_PATH})
message(" * GitRef(S) : " ${PROJECT_GIT_COMMIT_HASH})
message(" * NRF52 SDK : " ${NRF5_SDK_PATH})
message(" * Target device : " ${TARGET_DEVICE})
if(USE_DEBUG_PINS)
message(" * Debug pins : Enabled")
else()
message(" * Debug pins : Disabled")
endif()
if(BUILD_DFU)
message(" * Build DFU (using adafruit-nrfutil) : Enabled")
else()
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ Fast open-source firmware for the [PineTime smartwatch](https://www.pine64.org/p
- [Tips on designing an app UI](doc/ui_guidelines.md)
- [Bootloader, OTA and DFU](bootloader/README.md)
- [External resources](doc/ExternalResources.md)
- [Versioning](doc/versioning.md)
- [Project branches](doc/branches.md)
- [Files included in the release notes](doc/filesInReleaseNotes.md)

### Contributing

Expand All @@ -60,6 +57,13 @@ Fast open-source firmware for the [PineTime smartwatch](https://www.pine64.org/p

- [Memory analysis](doc/MemoryAnalysis.md)

### Project management

- [Maintainer's guide](doc/maintainer-guide.md)
- [Versioning](doc/versioning.md)
- [Project branches](doc/branches.md)
- [Files included in the release notes](doc/filesInReleaseNotes.md)

## Licenses

This project is released under the GNU General Public License version 3 or, at your option, any later version.
Expand All @@ -73,7 +77,7 @@ It integrates the following projects:

## Credits

I’m not working alone on this project. First, many people create PR for this projects. Then, there is the whole #pinetime community : a lot of people all around the world who are hacking, searching, experimenting and programming the Pinetime. We exchange our ideas, experiments and code in the chat rooms and forums.
I’m not working alone on this project. First, many people create PR for this project. Then, there is the whole #pinetime community : a lot of people all around the world who are hacking, searching, experimenting and programming the Pinetime. We exchange our ideas, experiments and code in the chat rooms and forums.

Here are some people I would like to highlight:

Expand Down
2 changes: 1 addition & 1 deletion doc/code/Apps.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ in the compilation by adding it to [CMakeLists.txt](/CMakeLists.txt).
The next step to making it launchable is to give your app an id.
To do this, add an entry in the enum class `Pinetime::Applications::Apps` ([displayapp/Apps.h](/src/displayapp/Apps.h)).
Name this entry after your app. Add `#include "displayapp/screens/MyApp.h"` to the file [displayapp/DisplayApp.cpp](/src/displayapp/DisplayApp.cpp).
Now, go to the function `DisplayApp::LoadApp` and add another case to the switch statement.
Now, go to the function `DisplayApp::LoadScreen` and add another case to the switch statement.
The case will be the id you gave your app earlier.
If your app needs any additional arguments, this is the place to pass them.

Expand Down
21 changes: 15 additions & 6 deletions doc/contribute.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
# How to contribute?

- [Report bugs](https://github.com/InfiniTimeOrg/InfiniTime/issues/new?assignees=&labels=bug&template=bug-report.yaml)
- Write and improve documentation
- Documentation might be incomplete, or not clear enough, and it is always possible to improve it with better wording, pictures, videos,...
- As the documentation is part of the source code, you can submit changes to the documentation by creating a pull request (see below)
- Fix bugs, add functionalities and improve the code
- See *How to create a pull request* below
Here are things you can do to help.

- [Report bugs or issues](https://github.com/InfiniTimeOrg/InfiniTime/issues/new/choose)
- [Write and improve documentation](#documentation)
- [Fix bugs, add functionalities and improve the code](#how-to-create-a-pull-request)
- Participate in the discussions within issues and PRs. Your feedback is appreciated!
- Review pull requests. Follow the instructions [here](maintainer-guide.md#reviewing-prs)

## Documentation

Documentation might be incomplete,
or not clear enough,
and it is always possible to improve it with better wording, pictures, videos,...
As the documentation is part of the source code,
you can submit changes to the documentation by creating a [pull request](#how-to-create-a-pull-request)

## How to create a pull request?

Expand Down
Loading

0 comments on commit 4d37e1c

Please sign in to comment.