diff options
Diffstat (limited to '.github')
| -rw-r--r-- | .github/ISSUE_TEMPLATE/bug-report.yaml | 8 | ||||
| -rw-r--r-- | .github/ISSUE_TEMPLATE/config.yml | 3 | ||||
| -rw-r--r-- | .github/ISSUE_TEMPLATE/feature-request.yaml | 41 | ||||
| -rw-r--r-- | .github/ISSUE_TEMPLATE/issue-report.yaml | 31 | ||||
| -rw-r--r-- | .github/workflows/docker.yml | 2 | ||||
| -rw-r--r-- | .github/workflows/format.yml | 4 | ||||
| -rwxr-xr-x | .github/workflows/getSize.sh | 19 | ||||
| -rw-r--r-- | .github/workflows/main.yml | 143 |
8 files changed, 186 insertions, 65 deletions
diff --git a/.github/ISSUE_TEMPLATE/bug-report.yaml b/.github/ISSUE_TEMPLATE/bug-report.yaml index 6e9f6606..4c85742a 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yaml +++ b/.github/ISSUE_TEMPLATE/bug-report.yaml @@ -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 diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index e5a555fd..5db3c45e 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -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. diff --git a/.github/ISSUE_TEMPLATE/feature-request.yaml b/.github/ISSUE_TEMPLATE/feature-request.yaml deleted file mode 100644 index a35bbfed..00000000 --- a/.github/ISSUE_TEMPLATE/feature-request.yaml +++ /dev/null @@ -1,41 +0,0 @@ -name: Feature Request -description: File a feature request -labels: ["feature request"] -body: - - type: markdown - attributes: - value: | - **Thanks for taking the time to fill out this feature request!** - *Please, before opening a feature request, check if similar issues already exist. In that case, use those issues to provide your feedback instead.* - - type: checkboxes - attributes: - label: Verification - options: - - label: I searched for similar feature request and found none was relevant. - required: true - - type: markdown - attributes: - value: | - **Note:** keep in mind that, while InfiniTime is usable, it is still under heavy development and as such it is continuously evolving. - Some features you want to see implemented might not be compatible with the current state of the project, or might not even be suitable to include *in the firmware* of the watch. - - type: input - id: desc-brief - attributes: - label: Pitch us your idea! - description: A one-line elevator pitch of the feature you'd like to see implemented. - placeholder: "Ex. My dog wants InfiniTime on its smart collar." - validations: - required: true - - type: textarea - id: desc-long - attributes: - label: Description - description: | - Give us a detailed description of the feature you are proposing. Mockups or a description of the possible use cases are highly appreciated. - Tell us why this should be included in the firmware. - placeholder: "Ex. Here is a drawing of my dog wearing an InfiniTime collar and smiling." - - type: markdown - id: companion-app - attributes: - value: | - If this requires features missing from other software (for example a companion app), please take care of opening any relevant feature request over there as well. diff --git a/.github/ISSUE_TEMPLATE/issue-report.yaml b/.github/ISSUE_TEMPLATE/issue-report.yaml new file mode 100644 index 00000000..f46499aa --- /dev/null +++ b/.github/ISSUE_TEMPLATE/issue-report.yaml @@ -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 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 8d45fe08..7af81515 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -14,7 +14,7 @@ on: jobs: build: - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 env: USERNAME: infinitime steps: diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 23f71a94..32451a0b 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -23,7 +23,7 @@ jobs: - name: Install clang-format run: | sudo apt-get update - sudo apt-get -y install clang-format-12 + sudo apt-get -y install clang-format-14 - name: Check formatting run: tests/test-format.sh @@ -55,7 +55,7 @@ jobs: - name: Install clang-tidy run: | apt-get update - apt-get -y install clang-tidy-12 + apt-get -y install clang-tidy-14 - name: Prepare environment shell: bash env: diff --git a/.github/workflows/getSize.sh b/.github/workflows/getSize.sh new file mode 100755 index 00000000..52a86132 --- /dev/null +++ b/.github/workflows/getSize.sh @@ -0,0 +1,19 @@ +#!/bin/sh + +# Requires environment variables from docker/build.sh + +set -e + +SIZE_BIN="$TOOLS_DIR/$GCC_ARM_PATH/bin/arm-none-eabi-size" +[ ! -x "$SIZE_BIN" ] && exit 1 + +[ -z "$1" ] && exit 1 +SIZE_OUTPUT=$($SIZE_BIN "$1" | tail -n1) + +TEXT_SIZE=$(echo "$SIZE_OUTPUT" | cut -f 1 |tr -d '[:blank:]') +DATA_SIZE=$(echo "$SIZE_OUTPUT" | cut -f 2 |tr -d '[:blank:]') +BSS_SIZE=$(echo "$SIZE_OUTPUT" | cut -f 3 |tr -d '[:blank:]') + +echo "text_size=$TEXT_SIZE" +echo "data_size=$DATA_SIZE" +echo "bss_size=$BSS_SIZE" diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 35d5ed1c..cdef2d03 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,28 +13,32 @@ on: - 'doc/**' - '**.md' - jobs: build-firmware: runs-on: ubuntu-latest container: image: infinitime/infinitime-build + outputs: + text_size: ${{ steps.output-sizes.outputs.text_size }} + data_size: ${{ steps.output-sizes.outputs.data_size }} + bss_size: ${{ steps.output-sizes.outputs.bss_size }} + env: + # InfiniTime sources are downloaded to the current directory. + # Override SOURCES_DIR in build.sh + SOURCES_DIR: . 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 + uses: actions/checkout@v3 with: submodules: recursive - name: Build shell: bash - env: - SOURCES_DIR: . run: /opt/build.sh all + - name: Output build size + id: output-sizes + run: | + . /opt/build.sh + .github/workflows/getSize.sh "$BUILD_DIR"/src/pinetime-app-*.out >> $GITHUB_OUTPUT # 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 @@ -55,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/get-cmake@v3.18.3 - - 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 lv_font_conv@1.5.2 - name: Checkout source files - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: recursive @@ -93,3 +98,111 @@ jobs: with: name: infinisim-${{ github.head_ref }} path: build_lv_sim/infinisim + + get-base-ref-size: + if: github.event_name == 'pull_request' + runs-on: ubuntu-22.04 + container: + image: infinitime/infinitime-build + outputs: + text_size: ${{ steps.output-sizes.outputs.text_size }} + data_size: ${{ steps.output-sizes.outputs.data_size }} + bss_size: ${{ steps.output-sizes.outputs.bss_size }} + env: + # InfiniTime sources are downloaded to the current directory. + # Override SOURCES_DIR in build.sh + SOURCES_DIR: . + steps: + - name: Checkout current base branch files + uses: actions/checkout@v3 + with: + ref: ${{ github.base_ref }} + submodules: recursive + + - 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 + run: /opt/build.sh all + + - name: Output build size + id: output-sizes + run: | + . /opt/build.sh + .github/workflows/getSize.sh "$BUILD_DIR"/src/pinetime-app-*.out >> $GITHUB_OUTPUT + + compare-build-size: + if: github.event_name == 'pull_request' + needs: [build-firmware, get-base-ref-size] + runs-on: ubuntu-latest + steps: + - name: Compare build size + id: output-sizes-diff + run: | + TEXT_SIZE=${{ needs.build-firmware.outputs.text_size }} + DATA_SIZE=${{ needs.build-firmware.outputs.data_size }} + BSS_SIZE=${{ needs.build-firmware.outputs.bss_size }} + + echo "text_size=$TEXT_SIZE" + echo "data_size=$DATA_SIZE" + echo "bss_size=$BSS_SIZE" + + echo "text_size=$TEXT_SIZE" >> $GITHUB_OUTPUT + echo "data_size=$DATA_SIZE" >> $GITHUB_OUTPUT + echo "bss_size=$BSS_SIZE" >> $GITHUB_OUTPUT + + TEXT_SIZE_BASE=${{ needs.get-base-ref-size.outputs.text_size }} + DATA_SIZE_BASE=${{ needs.get-base-ref-size.outputs.data_size }} + BSS_SIZE_BASE=${{ needs.get-base-ref-size.outputs.bss_size }} + + TEXT_SIZE_DIFF=$((TEXT_SIZE - TEXT_SIZE_BASE)) + DATA_SIZE_DIFF=$((DATA_SIZE - DATA_SIZE_BASE)) + BSS_SIZE_DIFF=$((BSS_SIZE - BSS_SIZE_BASE)) + + echo "text_diff=$TEXT_SIZE_DIFF" + echo "data_diff=$DATA_SIZE_DIFF" + echo "bss_diff=$BSS_SIZE_DIFF" + + echo "text_diff=$TEXT_SIZE_DIFF" >> $GITHUB_OUTPUT + 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 + 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 |
