Skip to content

Commit

Permalink
WIP temporary change to test size changes
Browse files Browse the repository at this point in the history
  • Loading branch information
aykevl committed May 4, 2023
1 parent b6ee562 commit 7eaa24f
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 75 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: macOS

on:
pull_request:
push:
branches:
- dev
- release
#pull_request:
#push:
# branches:
# - dev
# - release

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Linux

on:
pull_request:
push:
branches:
- dev
- release
#pull_request:
#push:
# branches:
# - dev
# - release

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
133 changes: 74 additions & 59 deletions .github/workflows/sizediff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,72 +18,87 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Install apt dependencies
run: |
echo 'deb https://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main' | sudo tee /etc/apt/sources.list.d/llvm.list
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install --no-install-recommends -y \
llvm-15-dev \
clang-15 \
libclang-15-dev \
lld-15
- name: Restore LLVM source cache
uses: actions/cache@v3
id: cache-llvm-source
with:
key: llvm-source-15-sizediff-v1
path: |
llvm-project/compiler-rt
- name: Download LLVM source
if: steps.cache-llvm-source.outputs.cache-hit != 'true'
run: make llvm-source
- name: Cache Go
uses: actions/cache@v3
with:
key: go-cache-linux-sizediff-v1-${{ hashFiles('go.mod') }}
path: |
~/.cache/go-build
~/go/pkg/mod
- run: make gen-device -j4
- name: Download drivers repo
run: git clone https://github.com/tinygo-org/drivers.git
fetch-depth: 0
# submodules: true
#- name: Install apt dependencies
# run: |
# echo 'deb https://apt.llvm.org/jammy/ llvm-toolchain-jammy-15 main' | sudo tee /etc/apt/sources.list.d/llvm.list
# wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
# sudo apt-get update
# sudo apt-get install --no-install-recommends -y \
# llvm-15-dev \
# clang-15 \
# libclang-15-dev \
# lld-15
#- name: Restore LLVM source cache
# uses: actions/cache@v3
# id: cache-llvm-source
# with:
# key: llvm-source-15-sizediff-v1
# path: |
# llvm-project/compiler-rt
#- name: Download LLVM source
# if: steps.cache-llvm-source.outputs.cache-hit != 'true'
# run: make llvm-source
#- name: Cache Go
# uses: actions/cache@v3
# with:
# key: go-cache-linux-sizediff-v1-${{ hashFiles('go.mod') }}
# path: |
# ~/.cache/go-build
# ~/go/pkg/mod
#- run: make gen-device -j4
#- name: Download drivers repo
# run: git clone https://github.com/tinygo-org/drivers.git

# Compute sizes for the PR branch
- name: Build tinygo binary
run: go install
- name: Determine binary sizes on the PR branch
run: (cd drivers; make smoke-test XTENSA=0 | tee sizes-pr.txt)
#- name: Pull other branches
# run: git fetch --recurse-submodules=no origin

# Compute sizes for the dev branch
- run: git status
- run: git log -10
- run: git show
- name: Save HEAD
run: git branch github-actions-saved-HEAD HEAD
- name: Checkout dev branch
run: |
git fetch origin
git checkout `git merge-base HEAD origin/dev`
- name: Build tinygo binary for the dev branch
run: go install
- name: Determine binary sizes on the dev branch
run: (cd drivers; make smoke-test XTENSA=0 | tee sizes-dev.txt)
run: git checkout --no-recurse-submodules `git merge-base HEAD origin/dev`
- run: git log -10
#- name: Build tinygo binary
# run: go install
#- name: Determine binary sizes on the dev branch
# run: (cd drivers; make smoke-test XTENSA=0 | tee sizes-dev.txt)

# Compute sizes for the PR branch
- run: git log -10 HEAD
- run: git log -10 origin/dev
- run: git merge-base HEAD origin/dev
- name: Checkout PR branch
run: git checkout --no-recurse-submodules github-actions-saved-HEAD
- run: git status
- run: git log -10
#- name: Build tinygo binary for the dev branch
# run: go install
#- name: Determine binary sizes on the dev branch
# run: (cd drivers; make smoke-test XTENSA=0 | tee sizes-dev.txt)

# Create comment
# TODO: add a summary, something like:
# - overall size difference (percent)
# - number of binaries that grew / shrank / remained the same
# - don't show the full diff when no binaries changed
- name: Calculate size diff
run: ./tools/sizediff drivers/sizes-dev.txt drivers/sizes-pr.txt | tee sizediff.txt
- name: Create comment
run: |
echo "Size difference with the dev branch:" > comment.txt
echo "<details><summary>Binary size difference</summary>" >> comment.txt
echo "<pre>" >> comment.txt
cat sizediff.txt >> comment.txt
echo "</pre></details>" >> comment.txt
- name: Comment contents
run: cat comment.txt
- name: Add comment
uses: thollander/actions-comment-pull-request@v2
with:
filePath: comment.txt
comment_tag: sizediff
#- name: Calculate size diff
# run: ./tools/sizediff drivers/sizes-dev.txt drivers/sizes-pr.txt | tee sizediff.txt
#- name: Create comment
# run: |
# echo "Size difference with the dev branch:" > comment.txt
# echo "<details><summary>Binary size difference</summary>" >> comment.txt
# echo "<pre>" >> comment.txt
# cat sizediff.txt >> comment.txt
# echo "</pre></details>" >> comment.txt
#- name: Comment contents
# run: cat comment.txt
#- name: Add comment
# uses: thollander/actions-comment-pull-request@v2
# with:
# filePath: comment.txt
# comment_tag: sizediff
10 changes: 5 additions & 5 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Windows

on:
pull_request:
push:
branches:
- dev
- release
#pull_request:
#push:
# branches:
# - dev
# - release

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/runtime_nrf.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ func main() {
if nrf.FPUPresent {
arm.SCB.CPACR.Set(0) // disable FPU if it is enabled
}
machine.InitSerial()
systemInit()
preinit()
run()
exit(0)
}

func init() {
machine.InitSerial()
initLFCLK()
initRTC()
}
Expand Down

0 comments on commit 7eaa24f

Please sign in to comment.