Giter Club home page Giter Club logo

cargo-action's Introduction

cargo-action

A simple GitHub Action to invoke cargo/cross. Inputs and usage inspired by action-rs' cargo action, with dtolnay's rust-toolchain as reference.

Written for use in personal projects (i.e. bottom), though feel free to use it on your own. Obligatory disclaimer that it may or may not work for your use case though - I'm open to issue reports and PRs however!

Usage

Note - this action does not install Rust for you, you will want to install a toolchain prior to running this (e.g. dtolnay/rust-toolchain).

Inputs

Note: Inputs aren't necessarily checked to be valid by this action!

Name Description
command The cargo command to run (e.g. build, test). Required.
toolchain The toolchain to use. Do not include the + sign (e.g. nightly, beta). Defaults to stable.
args What arguments to pass to the cargo/cross command.
use-cross Whether to use cross instead of using cargo. If enabled, cross will automatically be installed if needed.
cross-version The cross version to use. Only used if use-cross is enabled. If this is not set, it will default to the newest stable version of cross. main or git:XYZ are also valid options.
directory Change to the specified directory prior to execution. Useful if your repo's base folder does not contain your Rust project.

Example

name: Test
on: push

jobs:
  test:
  runs-on: ubuntu-latest
  steps:
    - uses: actions/checkout@v3
    - uses: dtolnay/rust-toolchain@stable
    - uses: ClementTsang/[email protected]
      with:
        command: test
        args: --lib --bins --benches
        use-cross: true
        cross-version: 0.2.4

cargo-action's People

Contributors

clementtsang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cargo-action's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.