mirror of
https://github.com/kennyp/asdf-golang.git
synced 2024-10-05 12:12:06 +08:00
Add Specs (#96)
* Initialize shellspec and add to workflow. * Automatic Yes to shellspec prompts. * Install and Run ShellSpec as one job. * Add find to debug action. * Use shellspec in lib dir. * Run ShellSpec on matrix * Add shellspec to it's own workflow. * Move shellspec.yml back into main.yml because checkout.
This commit is contained in:
parent
be7daa8c57
commit
99f0baf0af
8
.github/workflows/main.yml
vendored
8
.github/workflows/main.yml
vendored
@ -25,6 +25,14 @@ jobs:
|
||||
with:
|
||||
command: go version
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Run ShellSpec
|
||||
run: |
|
||||
curl -fsSL https://git.io/shellspec | sh -s 0.28.1 -p ./tools -y
|
||||
./tools/lib/shellspec/bin/shellspec
|
||||
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
|
12
.shellspec
Normal file
12
.shellspec
Normal file
@ -0,0 +1,12 @@
|
||||
--require spec_helper
|
||||
|
||||
## Default kcov (coverage) options
|
||||
# --kcov-options "--include-path=. --path-strip-level=1"
|
||||
# --kcov-options "--include-pattern=.sh"
|
||||
# --kcov-options "--exclude-pattern=/.shellspec,/spec/,/coverage/,/report/"
|
||||
|
||||
## Example: Include script "myprog" with no extension
|
||||
# --kcov-options "--include-pattern=.sh,myprog"
|
||||
|
||||
## Example: Only specified files/directories
|
||||
# --kcov-options "--include-pattern=myprog,/lib/"
|
24
spec/spec_helper.sh
Normal file
24
spec/spec_helper.sh
Normal file
@ -0,0 +1,24 @@
|
||||
# shellcheck shell=sh
|
||||
|
||||
# Defining variables and functions here will affect all specfiles.
|
||||
# Change shell options inside a function may cause different behavior,
|
||||
# so it is better to set them here.
|
||||
# set -eu
|
||||
|
||||
# This callback function will be invoked only once before loading specfiles.
|
||||
spec_helper_precheck() {
|
||||
# Available functions: info, warn, error, abort, setenv, unsetenv
|
||||
# Available variables: VERSION, SHELL_TYPE, SHELL_VERSION
|
||||
: minimum_version "0.28.1"
|
||||
}
|
||||
|
||||
# This callback function will be invoked after a specfile has been loaded.
|
||||
spec_helper_loaded() {
|
||||
:
|
||||
}
|
||||
|
||||
# This callback function will be invoked after core modules has been loaded.
|
||||
spec_helper_configure() {
|
||||
# Available functions: import, before_each, after_each, before_all, after_all
|
||||
: import 'support/custom_matcher'
|
||||
}
|
Loading…
Reference in New Issue
Block a user