Update README
and perform some cleanup
This commit is contained in:
parent
5e61fdf6fd
commit
ce25466c7a
25
.github/workflows/checkin.yml
vendored
25
.github/workflows/checkin.yml
vendored
@ -1,25 +0,0 @@
|
||||
name: "PR Checks"
|
||||
on: [pull_request, push]
|
||||
|
||||
jobs:
|
||||
check_pr:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: "npm ci"
|
||||
run: npm ci
|
||||
|
||||
- name: "npm run build"
|
||||
run: npm run build
|
||||
|
||||
- name: "npm run test"
|
||||
run: npm run test
|
||||
|
||||
- name: "check for uncommitted changes"
|
||||
# Ensure no changes, but ignore node_modules dir since dev/fresh ci deps installed.
|
||||
run: |
|
||||
git diff --exit-code --stat -- . ':!node_modules' \
|
||||
|| (echo "##[error] found changed files after build. please 'npm run build && npm run format'" \
|
||||
"and check in all changes" \
|
||||
&& exit 1)
|
4
LICENSE
4
LICENSE
@ -1,7 +1,7 @@
|
||||
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2018 GitHub, Inc. and contributors
|
||||
Copyright (c) 2018 Héctor Ramón; GitHub, Inc. and contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@ -19,4 +19,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
THE SOFTWARE.
|
||||
|
39
README.md
39
README.md
@ -1,9 +1,38 @@
|
||||
# JavaScript Action Template
|
||||
# setup-rust-action
|
||||
|
||||
This template offers an easy way to get started writing a javascript action with TypeScript compile time support, unit testing with Jest and using the GitHub Actions Toolkit.
|
||||
[![Integration test status](https://github.com/hecrj/setup-rust-action/workflows/Integration%20test/badge.svg)](https://github.com/hecrj/setup-rust-action/actions)
|
||||
|
||||
## Getting Started
|
||||
Sets up a specific Rust toolchain for use in your GitHub Actions workflows.
|
||||
|
||||
See the walkthrough located [here](https://github.com/actions/toolkit/blob/master/docs/javascript-action.md).
|
||||
# Usage
|
||||
|
||||
In addition to walking your through how to create an action, it also provides strategies for versioning, releasing and referencing your actions.
|
||||
Provide a `rust-version` with the desired toolchain version to install.
|
||||
|
||||
```yml
|
||||
name: Test
|
||||
on: [push]
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macOS-latest]
|
||||
rust: [stable, nightly]
|
||||
|
||||
steps:
|
||||
- uses: hecrj/setup-rust-action@master
|
||||
with:
|
||||
rust-version: ${{ matrix.rust }}
|
||||
- uses: actions/checkout@master
|
||||
- name: Run tests
|
||||
run: cargo test --verbose
|
||||
```
|
||||
|
||||
For more details, check out [`action.yml`].
|
||||
|
||||
[`action.yml`]: https://github.com/hecrj/setup-rust-action/blob/master/action.yml
|
||||
|
||||
# Contributing / Feedback
|
||||
|
||||
Contributions and feedback are welcome! Feel free to open any issues or pull
|
||||
requests.
|
||||
|
@ -1,5 +1,5 @@
|
||||
name: 'Set up Rust'
|
||||
description: 'Install a Rust toolchain and add it to the PATH'
|
||||
description: 'Install a specific Rust toolchain and add it to the PATH'
|
||||
author: 'Héctor Ramón'
|
||||
inputs:
|
||||
rust-version:
|
||||
|
@ -1,22 +0,0 @@
|
||||
# Contributors
|
||||
|
||||
### Checkin
|
||||
|
||||
- Do checkin source (src)
|
||||
- Do checkin build output (lib)
|
||||
- Do checkin runtime node_modules
|
||||
- Do not checkin devDependency node_modules (husky can help see below)
|
||||
|
||||
### devDependencies
|
||||
|
||||
In order to handle correctly checking in node_modules without devDependencies, we run [Husky](https://github.com/typicode/husky) before each commit.
|
||||
This step ensures that formatting and checkin rules are followed and that devDependencies are excluded. To make sure Husky runs correctly, please use the following workflow:
|
||||
|
||||
```
|
||||
npm install # installs all devDependencies including Husky
|
||||
git add abc.ext # Add the files you've changed. This should include files in src, lib, and node_modules (see above)
|
||||
git commit -m "Informative commit message" # Commit. This will run Husky
|
||||
```
|
||||
|
||||
During the commit step, Husky will take care of formatting all files with [Prettier](https://github.com/prettier/prettier) as well as pruning out devDependencies using `npm prune --production`.
|
||||
It will also make sure these changes are appropriately included in your commit (no further work is needed)
|
Loading…
Reference in New Issue
Block a user