You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 1, 2022. It is now read-only.
Add memory usage trends report feature to compile-examples action
When the feature is enabled, memory usage data for a selected example sketch is published to a Google Sheets spreadsheet on every push to the repository's default branch.
Copy file name to clipboardExpand all lines: libraries/compile-examples/README.md
+67Lines changed: 67 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,61 @@ Set to `true` to cause the action to determine the change in memory usage for th
36
36
37
37
Folder to save the JSON formatted memory usage change reports to. Should be used only to store reports. It will be created under [`GITHUB_WORKSPACE`](https://help.github.com/en/actions/configuring-and-managing-workflows/using-environment-variables). The folder will be created if it doesn't already exist. Default `"size-deltas-reports"`.
38
38
39
+
### `enable-size-trends-report`
40
+
41
+
Set to `true` to cause the action to record the memory usage of [`size-reports-sketch`](#size-reports-sketch) to a Google Sheets spreadsheet on every push to the repository's default branch. Default `false`.
42
+
43
+
### `size-trends-report-key-file`
44
+
45
+
Contents of the Google key file used to update the size trends report Google Sheets spreadsheet. This should be defined using a [GitHub secret](https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets). Default `""`.
46
+
1. Open https://console.developers.google.com/project
47
+
1. Click the "Create Project" button.
48
+
1. In the "Project name" field, enter the name you want for your project.
49
+
1. You don't need to select anything from the "Location" menu.
50
+
1. Click the button with the three horizontal lines at the top left corner of the window.
51
+
1. Hover the mouse pointer over "APIs & Services".
52
+
1. Click "Library".
53
+
1. Make sure the name of the project you created is selected from the dropdown menu at the top of the window.
54
+
1. Click 'Google Sheets API".
55
+
1. Click the "Enable" button.
56
+
1. Click the "Create Credentials" button.
57
+
1. From the "Which API are you using?" menu, select "Google Sheets API".
58
+
1. From the "Where will you be calling the API from?" menu, select "Other non-UI".
59
+
1. From the "What data will you be accessing?" options, select "Application data".
60
+
1. From the "Are you planning to use this API with App Engine or Compute Engine?" options, select "No, I’m not using them".
61
+
1. Click the "What credentials do I need?" button.
62
+
1. In the "Service account name" field, enter the name you want to use for the service account.
63
+
1. From the "Role" menu, select "Project > Editor".
64
+
1. From the "Key type" options, select "JSON".
65
+
1. Click the "Continue" button. The .json file containing your private key will be downloaded. Save this somewhere safe.
66
+
1. Open the downloaded file.
67
+
1. Copy the entire contents of the file to the clipboard.
68
+
1. Open the GitHub page of the repository you are configuring the GitHub Actions workflow for.
69
+
1. Click the "Settings" tab.
70
+
1. From the menu on the left side of the window, click "Secrets".
71
+
1. Click the "Add a new secret" link.
72
+
1. In the "Name" field, enter the variable name you want to use for your secret. This will be used for the `size-trends-report-key-file` argument of the `compile-examples` action in your workflow configuration file. For example, if you named the secret `GOOGLE_KEY_FILE`, you would reference it in your workflow configuration as `${{ secrets.GOOGLE_KEY_FILE }}`.
73
+
1. In the "Value" field, paste the contents of the key file.
74
+
1. Click the "Add secret" button.
75
+
1. Open the downloaded key file again.
76
+
1. Copy the email address shown in the `client_email` field.
77
+
1. Open Google Sheets: https://docs.google.com/spreadsheets
78
+
1. Under "Start a new spreadsheet", click "Blank".
79
+
1. Click the "Share" button at the top right corner of the window.
80
+
1. If you haven't already, give your spreadsheet a name.
81
+
1. Paste the `client_email` email address into the "Enter names or email addresses..." field.
82
+
1. Uncheck the box next to "Notify people".
83
+
1. Click the "OK" button.
84
+
1. In the "Skip sending invitations?" dialog, click the "OK" button.
85
+
86
+
### `size-trends-report-spreadsheet-id`
87
+
88
+
The ID of the Google Sheets spreadsheet to write the memory usage trends data to. The URL of your spreadsheet will look something like `https://docs.google.com/spreadsheets/d/15WOp3vp-6AnTnWlNWaNWNl61Fe_j8UJhIKE0rVdV-7U/edit#gid=0`. In this example, the spreadsheet ID is `15WOp3vp-6AnTnWlNWaNWNl61Fe_j8UJhIKE0rVdV-7U`. Default `""`.
89
+
90
+
### `size-trends-report-sheet-name`
91
+
92
+
The sheet name in the Google Sheets spreadsheet used for the memory usage trends report. Default `"Sheet1"`.
93
+
39
94
## Example usage
40
95
41
96
Only compiling examples:
@@ -57,3 +112,15 @@ Storing the memory usage change report as a [workflow artifact](https://help.git
57
112
name: size-deltas-reports
58
113
path: size-delta-reports
59
114
```
115
+
116
+
Publishing memory usage trends data to a Google Sheets spreadsheet:
0 commit comments