Skip to content

Commit

Permalink
Updated docs and CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ulises-jeremias committed Feb 28, 2022
1 parent b803252 commit ab09c57
Show file tree
Hide file tree
Showing 2 changed files with 114 additions and 1 deletion.
50 changes: 50 additions & 0 deletions .github/workflows/check-dist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# `dist/index.js` is a special file in Actions.
# When you reference an action with `uses:` in a workflow,
# `index.js` is the code that will run.
# For our project, we generate this file through a build process
# from other source files.
# We need to make sure the checked-in `index.js` actually matches what we expect it to be.
name: Check dist

on:
push:
branches:
- main
paths-ignore:
- '**.md'
pull_request:
paths-ignore:
- '**.md'
workflow_dispatch:

jobs:
check-dist:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set Node.js 12.x
uses: actions/setup-node@v1
with:
node-version: 12.x

- name: Install dependencies
run: npm ci

- name: Rebuild the index.js file
run: npm run build

- name: Compare the expected and actual dist/ directories
run: |
if [ "$(git diff --ignore-space-at-eol dist/ | wc -l)" -gt "0" ]; then
echo "Detected uncommitted changes after build. See status below:"
git diff
exit 1
fi
# If dist/ was different than expected, upload the expected version as an artifact
- uses: actions/upload-artifact@v2
if: ${{ failure() && steps.diff.conclusion == 'failure' }}
with:
name: dist
path: dist/
65 changes: 64 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,64 @@
# Setup V
<div align="center">
<h1>Setup V</h1>

[vlang.io](https://vlang.io) |
[Contributing](https://github.com/vlang/setup-v/blob/main/CONTRIBUTING.md)

</div>
<div align="center">

[![CI][workflowbadge]][workflowurl]
[![License: MIT][licensebadge]][licenseurl]

</div>

GitHub Action that allows you to setup a V environment.

## Usage

```yaml
- uses: vlang/setup-v@v1
with:
# Personal access token (PAT) used to fetch the repository. The PAT is configured
# with the local git config, which enables your scripts to run authenticated git
# commands. The post-job step removes the PAT.
#
# We recommend using a service account with the least permissions necessary.
# Also when generating a new PAT, select the least scopes necessary.
#
# [Learn more about creating and using encrypted secrets](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/creating-and-using-encrypted-secrets)
#
# Default: ${{ github.token }}
token: ''

# Version to use. It can be the branch, tag or SHA to checkout from the V repository.
# Examples: 0.2.4, weekly.2022.07
version: ''

# File containing the version to use. It can contain the branch, tag or SHA to checkout from the V repository
# Examples: .v-version
version-file: ''

# Set this option if you want the action to check for the latest available version of V.
# If `stable` is false, it will check for the latest commit from the default branch.
check-latest: false

# Set this option if you want the action to use the stable version of V
stable: false

# Target architecture for V to use. Examples: linux, macos, windows. Will use system architecture by default.
architecture: ''
```
## Contributors
<a href="https://github.com/vlang/setup-v/contributors">
<img src="https://contrib.rocks/image?repo=vlang/setup-v"/>
</a>
Made with [contributors-img](https://contrib.rocks).
[workflowbadge]: https://github.com/vlang/setup-v/actions/workflows/ci.yml/badge.svg
[licensebadge]: https://img.shields.io/badge/License-MIT-blue.svg
[workflowurl]: https://github.com/vlang/setup-v/actions/workflows/ci.yml
[licenseurl]: https://github.com/vlang/setup-v/blob/main/LICENSE

0 comments on commit ab09c57

Please sign in to comment.