Bumps [@vitest/coverage-istanbul](https://github.com/vitest-dev/vitest/tree/HEAD/packages/coverage-istanbul) from 0.29.8 to 0.30.0. - [Release notes](https://github.com/vitest-dev/vitest/releases) - [Commits](https://github.com/vitest-dev/vitest/commits/v0.30.0/packages/coverage-istanbul) --- updated-dependencies: - dependency-name: "@vitest/coverage-istanbul" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Speckle Automate GitHub Action
Introduction
This repository contains the source code for the Speckle Automate GitHub Action. It is a GitHub Action that publishes a Speckle Automate Function to Speckle Automate your source code.
Documentation
Inputs
speckle_server_url
The URL of the Speckle Automate Server to publish the function to.
Defaults to https://automate.speckle.xyz.
speckle_token
The Speckle Automate API token to use to publish the function. This token must have functions:write permissions.
This must be stored in GitHub as an encrypted secret. This token must be protected, as it allows anyone with access to it to publish functions as you to your Speckle Automate Server.
If you believe your token has been compromised, please revoke it immediately on your Speckle Automate Server. Please also audit your Speckle Automate Function changes to ensure that they were not made by an unauthorized party.
Please note that this is not a Speckle Account token, but a Speckle Automate API token. You can create one by logging into the Speckle Automate Server and going to the API Tokens page.
speckle_function_path
The path to the Speckle Automate Function to publish. This path is relative to the root of the repository. If you provide a path to a directory, your Speckle Automate Function must be in a file named specklefunction.yaml within that directory.
function_id
Optional. If you have already registered a Speckle Function, you can use the ID of that Speckle Function to ensure that any changes are associated with it. If you do not provide a Function Id, we will attempt to determine the Function ID based on the GitHub server, GitHub repository, Reference (branch), and the Speckle Function Path.
Providing a Speckle Function ID allows you to change one of those values, and update the original Function instead of creating a new one.
Your Speckle Token must have write permissions for the Speckle Function with this ID, otherwise the publish will fail.
Outputs
function_id
The unique ID of the published function. This will be the same as the function_id input if it was provided. If you wish, you can use this ID as function_id input.
version_id
The unique ID of this version of the published function.
image_name
The name of the Docker image that you now need to build and push. Your Speckle Automate Token has been granted write permissions for publishing this image to the Speckle Automate Server.
Example usage
Speckle Automate GitHub Action will register a Speckle Function with Speckle Automate. This is a necessary, but not sufficient, step in publishing your Speckle Function. You must also build and push the Docker image that contains your Speckle Function.
Publish a function to automate.speckle.xyz
uses: actions/speckle-automate-github-action@0.1.0
with:
# speckle_server_url is optional and defaults to https://automate.speckle.xyz
# The speckle_token is a secret and must be stored in GitHub as an encrypted secret
# https://docs.github.com/en/actions/security-guides/encrypted-secrets#using-encrypted-secrets-in-a-workflow
speckle_token: ${{ secrets.SPECKLE_TOKEN }}
# speckle_function_path is optional and defaults to ./specklefunction.yaml
# function_id is optional and will be auto-generated if not provided
Publish a function to a self-hosted server
uses: actions/speckle-automate-github-action@0.1.0
with:
# please update to the url of your self-hosted server
speckle_server_url: https://example.org
# https://docs.github.com/en/actions/security-guides/encrypted-secrets#using-encrypted-secrets-in-a-workflow
speckle_token: ${{ secrets.SPECKLE_TOKEN }}
# speckle_function_path is optional and defaults to ./specklefunction.yaml
# function_id is optional and will be auto-generated if not provided
Example usage within an entire GitHub Actions Workflow
Publish a Speckle Function, and build the Docker Image using Docker
Docker is the original, and still one of the most popular, ways to build and publish Docker images. It does require that you provide a Dockerfile, which includes instructions to Docker for building your image.
Find out more about Docker and Dockerfiles by following Docker's Get Started Guide.
You can learn more about Docker's GitHub Action from their documentation in the GitHub Actions Marketplace.
name: ci
on:
push:
branches:
- 'main'
jobs:
docker:
runs-on: ubuntu-latest
steps:
-
# Checkout the code
# Docker's GitHub Action does not require this step
# but Speckle Automate does
name: Checkout
uses: actions/checkout@v3
-
id: speckle
name: Register Speckle Function
uses: actions/speckle-automate-github-action@0.1.0
with:
speckle_token: ${{ secrets.SPECKLE_TOKEN }}
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Docker needs to login to Speckle Automate
uses: docker/login-action@v2
with:
username: ${{ secrets.SPECKLE_USERNAME }}
password: ${{ secrets.SPECKLE_TOKEN }}
-
name: Build and push
uses: docker/build-push-action@v4
with:
# ## file is optional and defaults to {context}/Dockerfile
# file: ./Dockerfile
# ## context is optional and defaults to the root directory '.' of the repository
# context: .
# ## platforms is optional and defaults to linux/amd64
# ## platforms must match the platforms that you have registered with Speckle Automate, which also defaults to linux/amd64.
# platforms: linux/amd64
push: true
tags: ${{ steps.speckle.outputs.image_name }}
Developing & Debugging
Running locally
Prerequisites to running locally
Building
- Clone this repository
- Run
yarn installto install dependencies. - Run
yarn run allto validate, build, and test the project.
Developing
Prerequisites to developing
- Docker
- Node.js (v18)
- Yarn
- Pre-Commit
- Clone this repository
- Run
pre-commit installto install the pre-commit hooks - Run
yarn installto install dependencies
Testing
-
Run unit tests with coverage:
yarn test -
Run unit tests and watch for changes while developing:
yarn test:watch
Linting
- Run
yarn precommitto run all pre-commit hooks. - You must address all linting errors prior to committing changes. The CI will fail if there are any linting errors, and you will be unable to merge your PR.
Contributing
Please make sure you read the contribution guidelines and code of conduct for an overview of the practices we try to follow.
Community
The Speckle Community hangs out on the forum, do join and introduce yourself & feel free to ask us questions!
Security
For any security vulnerabilities or concerns, please contact us directly at security[at]speckle.systems.
License
Unless otherwise described, the code in this repository is licensed under the Apache-2.0 License. Please note that some modules, extensions or code herein might be otherwise licensed. This is indicated either in the root of the containing folder under a different license file, or in the respective file's header. If you have any questions, don't hesitate to get in touch with us via email.