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
The purpose of this repo is to create a centrally managed dependency
10
-
install script for all Adafruit CircuitPython Library Github Actions and Travis CI configs.
10
+
install script for all Adafruit CircuitPython Library Github Actions.
11
11
This will allow us to easily update the install steps without
12
-
having to manually or programatically update 100+ `.travis.yml` files or github workflows.
12
+
having to manually or programatically update 200+ GitHub workflows.
13
13
14
-
We have a guide that you can use to follow along to install both TravisCI and Doxygen generation here https://learn.adafruit.com/the-well-automated-arduino-library/
14
+
We have [a Learn guide](https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/testing-with-github-actions)
15
+
that you can use to follow along to using GitHub Actions.
15
16
16
-
## Adding to Github Actions Workflows
17
+
#Using in Workflow Files
17
18
18
-
This section should be added.
19
+
To use the install script in workflow files, you'll need to check out this
20
+
repository, followed by running the `install.sh` bash script.
19
21
20
-
## Adding to Travis CI Configs
22
+
You can clone and checkout this repo in a GitHub Actions workflow file using
23
+
`actions/checkout`:
21
24
22
-
You will need to source the script in the `before_install` step of your
You could use any version of IDE by setting `ARDUINO_IDE_VERSION` variable but we recommend keeping this variable unused because script gets updated and you then will not have to modify `.travis.yml` manually.
33
+
In the example above, the repo is now cloned as `actions-ci`.
64
34
65
-
## Automated Example Verification Bash Functions
35
+
The dependencies can then be downloaded using `install.sh`:
66
36
67
-
`build_platform`will build all `.ino` examples in the repo using the passed platform. The platforms
68
-
are defined in the `MAIN_PLATFORMS` and `AUX_PLATFORMS` associative arrays at the top of the script.
69
-
70
-
All of the examples will be built with the platforms in `MAIN_PLATFORMS` if you call `build_main_platforms`,
71
-
and `AUX_PLATFORMS` can be used to define other platforms that don't need to be verified for every repo.
72
-
73
-
Build the examples using the platforms in the MAIN_PLATFORMS array:
74
37
```yaml
75
-
script:
76
-
- build_main_platforms
77
-
```
78
-
79
-
Build the examples only using the trinket:
80
-
```yaml
81
-
script:
82
-
- build_platform trinket
83
-
```
84
-
85
-
### Skipping Platforms
86
-
87
-
If you would like to skip one of the main platforms when running `build_main_platforms`,
88
-
you can commit a `.YOUR_PLATFORM_HERE.test.skip` file to the example sketch directory you
89
-
wish to skip. You will need to use the array key defined in `MAIN_PLATFORMS` for the platform
90
-
you wish to skip.
91
-
92
-
For example, if you would like to skip the `esp8266` platform for an example
93
-
in your lib called `blink.ino`, you would need to do something like this in your library repo:
94
-
95
-
```sh
96
-
$ touch examples/blink/.esp8266.test.skip
97
-
$ git add -A
98
-
$ git commit -a
99
-
$ git push
100
-
```
101
-
102
-
If you need an easy way to skip a platform, you can also add something like this to your `~/.bash_profile`:
103
-
104
-
```sh
105
-
function travis_skip()
106
-
{
107
-
108
-
local platform_key=$1
109
-
110
-
# grab all pde and ino example sketches
111
-
local examples=$(find $PWD -name "*.pde" -o -name "*.ino")
112
-
113
-
# loop through example sketches
114
-
for example in $examples; do
115
-
116
-
# store the full path to the example's sketch directory
117
-
local example_dir=$(dirname $example)
118
-
119
-
touch ${example_dir}/.${platform_key}.test.skip
120
-
121
-
done
122
-
123
-
}
38
+
- name: Install dependencies
39
+
run: |
40
+
source action-ci/install.sh
124
41
```
125
42
126
-
You will then be able to skip a platform for all examples by running the `travis_skip` function from your library repo.
127
-
It will automatically add the `.YOUR_PLATFORM_HERE.test.skip` files to the examples.
128
-
129
-
```sh
130
-
$ travis_skip esp8266
131
-
```
132
-
133
-
## Using external libraries
134
-
External libraries (which are not hosted by the Arduino library manager) can be installed using the following command:
135
-
```sh
136
-
- if [ ! -d "$HOME/arduino_ide/libraries/<Name>" ]; then git clone <URL> $HOME/arduino_ide/libraries/<Name>; fi
137
-
```
138
-
139
-
## Deploying compiled artifacts
140
-
If you need to get hold of the compiled sketches of your project, in order to release them or forward them to an
141
-
deployment pipeline, you can find them in the `$ARDUINO_HEX_DIR` directory. Specifically, if `Foo` is the name
142
-
of your project, you are compiling for an `Arduino Mega` and the primary sketch is called `Foo.ino`, the flashable
143
-
`.hex`files will be found inside `$ARDUINO_HEX_DIR/mega2560/Foo` as `Foo.ino.hex` and `Foo.ino.with_bootloader.hex`.
144
-
Similarly for the rest of the platforms.
145
-
146
-
For example, assuming you have a `Foo` project as outlined above, to create a release which includes the `.hex`
147
-
files on GitHub, you could add this to your `.travis.yml` configuration:
0 commit comments