Skip to content

Commit

Permalink
Github Action Example / CI Refactor (#66)
Browse files Browse the repository at this point in the history
* Add installation instructions on read-me

* Update github-action to use asdf to install dependencies rather than docker

* Don't use 'v' in bats asdf config

* Update messaging in ci action

* Update messaging in ci action

* Update read-me for github-action example link

* Remove action-validator from asdf plugins
  • Loading branch information
mathew-fleisch committed May 26, 2022
1 parent 37a71da commit cac039e
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 14 deletions.
48 changes: 34 additions & 14 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,44 @@
name: Unit Tests and Linters

# Run this workflow every time a new commit pushed to your repository
on: push

on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
# Set the job key. The key is displayed as the job name
# when a job name is not provided
test-lint:
# Name the Job
name: Unit tests and Lint code base
# Set the type of machine to run on
runs-on: ubuntu-latest

steps:
# Checks out a copy of your repository on the ubuntu-latest machine
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Install dependencies with asdf
uses: asdf-vm/actions/install@v1
with:
tool_versions: |
bats 1.3.0
shellcheck 0.8.0
semver 3.3.0
- name: Display semver help
run: |
echo "Use semver locally or in your workflow!"
echo "asdf plugin add semver"
echo "asdf install semver latest"
echo "asdf global semver latest"
echo "semver --version"
semver --version
echo "semver --help"
semver --help
- name: Shellcheck linter
run: |
shellcheck src/semver
shellcheck test/documentation-test
- name: Unit tests
shell: bash
run: make test
- name: Linter
shell: bash
run: make lint
run: bats test
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Most likely, you will want to insure that the directory containing `semver` is o

See [installation alternatives](#installation-alternatives) below.

For an example of how to use semver in a github-action, checkout the [ci action](.github/workflows/ci.yaml) in this repository.

usage
-----

Expand Down

0 comments on commit cac039e

Please sign in to comment.