Repository navigation
128 lines (115 loc) · 3.72 KB
/
Copy pathcode-size.yml
File metadata and controls
128 lines (115 loc) · 3.72 KB
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: Code Size
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
paths:
- 'src/**'
- 'wolftpm/**'
- 'hal/**'
- 'configure'
- 'configure.ac'
- 'autogen.sh'
- 'm4/**'
- 'Makefile.am'
- '**/include.am'
- '.github/actions/setup-wolfssl/**'
- '.github/scripts/code-size-report.sh'
- '.github/scripts/code-size-advisory.sh'
- '.github/scripts/test-code-size-advisory.sh'
- '.github/scripts/test-code-size-report.sh'
- '.github/workflows/_resolve-wolfssl.yml'
- '.github/workflows/code-size-advisory.yml'
- '.github/workflows/code-size.yml'
push:
branches: [master]
paths:
- 'src/**'
- 'wolftpm/**'
- 'hal/**'
- 'configure'
- 'configure.ac'
- 'autogen.sh'
- 'm4/**'
- 'Makefile.am'
- '**/include.am'
- '.github/actions/setup-wolfssl/**'
- '.github/scripts/code-size-report.sh'
- '.github/scripts/code-size-advisory.sh'
- '.github/scripts/test-code-size-advisory.sh'
- '.github/scripts/test-code-size-report.sh'
- '.github/workflows/_resolve-wolfssl.yml'
- '.github/workflows/code-size-advisory.yml'
- '.github/workflows/code-size.yml'
workflow_dispatch:
inputs:
base_ref:
description: Git ref to compare against
required: false
default: master
permissions:
contents: read
# Warn when code-size growth exceeds this percentage.
env:
SIZE_MAX_GROWTH_PERCENT: 5
concurrency:
group: code-size-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
discover:
if: github.repository_owner == 'wolfSSL'
uses: ./.github/workflows/_resolve-wolfssl.yml
code-size:
name: Code size (${{ matrix.wolfssl-ref }})
if: github.repository_owner == 'wolfSSL'
needs: discover
runs-on: ubuntu-latest
container:
image: ghcr.io/wolfssl/wolftpm-ci:v1.1@sha256:ec2489d5dc9e9cde5dd97d4e2d59776d6c6748d4134dddd2fb4ede3225aee29f
defaults:
run:
shell: bash -e {0}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
wolfssl-ref: ${{ fromJSON(needs.discover.outputs.refs) }}
steps:
- name: Checkout proposed tree
uses: actions/checkout@v4
with:
path: head
fetch-depth: 1
- name: Checkout comparison base
uses: actions/checkout@v4
with:
path: base
fetch-depth: 1
ref: ${{ github.event.pull_request.base.sha || github.event.before || inputs.base_ref || 'master' }}
- name: Trust workspaces
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE/head"
git config --global --add safe.directory "$GITHUB_WORKSPACE/base"
- name: Setup wolfSSL ${{ matrix.wolfssl-ref }}
uses: ./head/.github/actions/setup-wolfssl
with:
configure-flags: --enable-wolftpm --enable-pkcallbacks --enable-keygen
cflags: -Os -g0 -DWC_RSA_NO_PADDING
ref: ${{ matrix.wolfssl-ref }}
- name: Test size tooling
run: |
head/.github/scripts/test-code-size-report.sh
head/.github/scripts/test-code-size-advisory.sh
- name: Compare code size
env:
SIZE_WARNING_FILE: ${{ runner.temp }}/code-size-warning.txt
run: >-
head/.github/scripts/code-size-report.sh
base head "$GITHUB_STEP_SUMMARY"
- name: Upload advisory result
uses: actions/upload-artifact@v4
with:
name: code-size-warning-${{ matrix.wolfssl-ref }}
path: ${{ runner.temp }}/code-size-warning.txt
if-no-files-found: error
overwrite: true
retention-days: 1