Skip to content

Repository files navigation

ANDYL GitHub Actions

Reusable GitHub Actions for ANDYL's projects.

Example

A minimal Rust library with tests is in the example/ directory, along with an Actions workflow that runs coverage testing.

Available Actions

setup-devenv

Installs Nix, Cachix, and devenv.

Example usage:

- name: Setup devenvuses: andyl-technologies/github-actions/setup-devenv@master

No parameters are required.

check-skip

Uses Graphite to detect if CI can be skipped for a pull request or commit.

This action sets an output named skip to true or false, and should usually be ran as a separate job.

Example usage:

jobs:
check-skip:
runs-on: ubuntu-latestoutputs:
skip: ${{ steps.check-skip.outputs.skip }}steps:
- name: Check if CI can be skippedid: check-skipuses: andyl-technologies/github-actions/check-skip@master

GitHub does not have a way to arbitrarily exit a workflow without marking it as "skipped" or "failed", both of which send out notifications which may not be desirable.

As such, taking advantage of this action without such notifications requires using the skip output as a conditional on all subsequent actions using needs and if, like so:

- uses: andyl-technologies/github-actions/check-skip@masterneeds: check-skipif: ${{ needs.check-skip.outputs.skip }} == 'false'

rust-cache

Sets up Rust caching mechanisms and dependencies using the following actions:

Example usage:

- name: Setup Rust cache/dependenciesuses: andyl-technologies/github-actions/setup-rust@masterwith:
# Condition in which the cache is savedsave-condition: ${{ github.ref == 'refs/heads/main' }}# Whether to cache all crates or only the current workspacecache-all-crates: 'false'# List of workspaces to cache, separated by commasworkspaces: .# Whether to use sccache for caching build artifactsuse-sccache: 'false'

If use-sccache is set, then two additional variables will need to be set for any consuming action, since GitHub Actions does not allow setting environment variables for consuming actions from a composite action like this one.

jobs:
env:
SCCACHE_GHA_ENABLED: 'true'RUSTC_WRAPPER: 'sccache'

setup-attic

Install and configure attic, a self-hosted Nix binary cache.

Requires Nix to be installed beforehand, preferably using nix-installer-action.

Example usage:

- name: Run Nix installeruses: DeterminateSystems/nix-installer-action@main
- name: Use Attic cacheuses: andyl-technologies/github-actions/push-to-attic@masterwith:
- name: andyl
- url: https://attic.andyl.com
- token: ${{ secrets.ATTIC_TOKEN }}

push-to-attic

Given a list of space-separated store paths, push them, along with all their dependencies to an Attic cache that has been pre-configured with the setup-attic action.

This action will be no longer needed once this GitHub issue is solved and the store can be watched properly.

Example usage:

- name: Push to cacheuses: andyl-technologies/github-actions/push-to-attic@masterwith:
cache: andylpaths: ./result ./result-2

About

Common actions for ANDYL's Rust-related configurations

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Used by

Contributors

Languages