Skip to content

Commit

Permalink
Merge pull request #12 from particle-iot/feature/sc-117902/fetching-p…
Browse files Browse the repository at this point in the history
…article-project-dependencies

Document library install workaround
  • Loading branch information
laupow authored May 2, 2023
2 parents a7d0d02 + f36f458 commit bf97e18
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,38 @@ $ curl "https://api.particle.io/v1/orgs/$ORG_SLUG/team?access_token=$TOKEN" -H "
}
}
```


## Known Issues

### Missing libraries or dependencies

The Cloud Compiler [automatically downloads](https://docs.particle.io/firmware/best-practices/libraries/#cloud-vs-local-compiles)
libraries defined in the `project.properties` file.

The `compile-action` does not currently download libraries when compiling inside the Action runner.

There are a few ways to work around this:
1. Check in your dependencies to your repository
1. Use the Cloud Compiler by setting the `particle-access-token` input
1. Use the [Particle CLI](https://docs.particle.io/tutorials/developer-tools/cli/) to install dependencies in CI

Here is an example that installs the Particle CLI and uses it to install libraries defined in `project.properties`:

```yaml

# Change working-directory to your sources folder
# Make sure to set a PARTICLE_ACCESS_TOKEN secret in your repository
- name: Install project dependencies
working-directory: src
run: |
npm install -g particle-cli
particle login --token "${{ secrets.PARTICLE_ACCESS_TOKEN }}"
# Make into an extended project if src doesn't exist
# Move all files except project.properties to src
if [ -f project.properties ] && [ ! -d src ]; then
mkdir src
find . ! -name project.properties ! -name src ! -name . -exec mv {} src \;
fi
particle library install --vendored -y
```

0 comments on commit bf97e18

Please sign in to comment.