This repository has been archived by the owner on Dec 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
21cbd33
commit 124a344
Showing
3 changed files
with
51 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
changelog: | ||
categories: | ||
- title: 🏕 Features | ||
labels: | ||
- '*' | ||
exclude: | ||
labels: | ||
- dependencies | ||
- title: 👒 Dependencies | ||
labels: | ||
- dependencies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,11 +10,7 @@ jobs: | |
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup BATS | ||
uses: mig4/setup-bats@v1 | ||
with: | ||
bats-version: 1.10.0 | ||
- name: Setup Bats-libs | ||
- name: Setup Bats and Bats-libs | ||
uses: brokenpip3/setup-bats-libs@main | ||
with: | ||
support-clean: "false" | ||
|
@@ -51,11 +47,7 @@ jobs: | |
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup BATS | ||
uses: mig4/setup-bats@v1 | ||
with: | ||
bats-version: 1.9.0 | ||
- name: Setup Bats-libs | ||
- name: Setup Bats and Bats-libs | ||
uses: brokenpip3/[email protected] | ||
with: | ||
support-clean: "false" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,124 +1,78 @@ | ||
# Setup Bats Libs | ||
|
||
GitHub Action to setup the four major [bats](https://github.com/bats-core/bats-core) libs: | ||
This GitHub Action installs [Bats](https://github.com/bats-core/bats-core) and the four major bats libraries: | ||
|
||
* [bats-support](https://github.com/bats-core/bats-support) | ||
* [bats-assert](https://github.com/bats-core/bats-assert) | ||
* [bats-detik](https://github.com/bats-core/bats-detik) | ||
* [bats-file](https://github.com/bats-core/bats-file) | ||
|
||
The action can be also instructed to select which libs that will be installed. | ||
The action can be also instructed to select which libraries to install. | ||
|
||
## How to use it | ||
|
||
Can be used in duo with [setup-bats](https://github.com/mig4/setup-bats) action | ||
to setup all the bats libs you need for your CI jobs. | ||
|
||
An example: | ||
|
||
``` yaml | ||
on: [push] | ||
|
||
jobs: | ||
my_test: | ||
runs-on: ubuntu-latest | ||
name: Install Bats common libs | ||
name: Install Bats and bats libs | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup BATS | ||
uses: mig4/setup-bats@v1 | ||
- name: Setup Bats libs | ||
uses: brokenpip3/[email protected] | ||
|
||
- name: Setup Bats and bats libs | ||
uses: brokenpip3/[email protected] | ||
``` | ||
## Inputs | ||
## Libraries Path | ||
The available inputs with their default values are provided below. | ||
For each of the Bats libraries, you can choose to install them in the default location (`/usr/lib/bats-<lib-name>`) or specify a custom path. | ||
|
||
``` yaml | ||
# ... | ||
- name: Setup Bats libs | ||
uses: brokenpip3/[email protected] | ||
with: | ||
support-install: true | ||
support-version: 0.3.0 | ||
support-path: /usr/lib/bats-support | ||
assert-install: true | ||
assert-version: 0.2.0 | ||
assert-path: /usr/lib/bats-assert | ||
detik-install: true | ||
detik-version: 1.1.0 | ||
detik-path: /usr/lib/bats-detik | ||
file-install: true | ||
file-version: 0.3.0 | ||
file-path: /usr/lib/bats-file | ||
``` | ||
For example, if you want to install `bats-support` in the `./test/bats-support` directory, you can configure it as follows: | ||
|
||
If you would like `bats-support` installed within the `./test/bats-support` directory, you | ||
can configure it as such: | ||
|
||
``` yaml | ||
# ... | ||
- name: Setup Bats libs | ||
- name: Setup Bats and Bats libs | ||
uses: brokenpip3/[email protected] | ||
with: | ||
with: | ||
support-path: ${{ github.workspace }}/test/bats-support | ||
``` | ||
|
||
### Bats-support | ||
|
||
* `support-install`: Bats-support installation, default to true | ||
* required: `false` | ||
* default: `true` | ||
|
||
* `support-version`: Bats-support version, default to latest | ||
* required: `false` | ||
* default: `0.3.0` | ||
|
||
* `support-path`: Bats-support path | ||
* required: `false` | ||
* default: `/usr/lib/bats-support` | ||
|
||
### Bats-assert | ||
|
||
* `assert-install`: Bats-assert installation, default to true | ||
* required: `false` | ||
* default: `true` | ||
|
||
* `assert-version`: Bats-assert version, default to latest | ||
* required: `false` | ||
* default: `0.2.0` | ||
|
||
* `assert-path`: Bats-assert path | ||
* required: `false` | ||
* default: `/usr/lib/bats-assert` | ||
## Inputs | ||
|
||
### Bats-detik | ||
| Key | Default | Required | Description | | ||
|------------------|---------|----------|------------------------------------------------| | ||
| bats-install | `true` | false | Bats installation, cache supported | | ||
| bats-version | `latest` | false | Bats version | | ||
| support-install | `true` | false | Bats-support installation | | ||
| support-version | `0.3.0` | false | Bats-support version | | ||
| support-path | `/usr/lib/bats-support` | false | Bats-support path | | ||
| support-clean | `true` | false | Bats-support: clean temp files | | ||
| assert-install | `true` | false | Bats-assert installation | | ||
| assert-version | `2.1.0` | false | Bats-assert version | | ||
| assert-path | `/usr/lib/bats-assert` | false | Bats-assert path | | ||
| assert-clean | `true` | false | Bats-assert: clean temp files | | ||
| detik-install | `true` | false | Bats-detik installation | | ||
| detik-version | `1.2.0` | false | Bats-detik version | | ||
| detik-path | `/usr/lib/bats-detik` | false | Bats-detik path | | ||
| detik-clean | `true` | false | Bats-detik: clean temp files | | ||
| file-install | `true` | false | Bats-file installation | | ||
| file-version | `0.3.0` | false | Bats-file version | | ||
| file-path | `/usr/lib/bats-file` | false | Bats-file path | | ||
| file-clean | `true` | false | Bats-file: clean temp files | | ||
|
||
* `detik-install`: Bats-detik installation, default to true | ||
* required: `false` | ||
* default: `true` | ||
## TODO | ||
|
||
* `detik-version`: Bats-detik version, default to latest | ||
* required: `false` | ||
* default: `1.1.0` | ||
* [X] Add more tests | ||
|
||
* `detik-path`: Bats-detik path | ||
* required: `false` | ||
* default: `/usr/lib/bats-detik` | ||
* [X] Add Bats binary | ||
|
||
### Bats-file | ||
* [X] Add cache for bats binary | ||
|
||
* `file-install`: Bats-file installation, default to true | ||
* required: `false` | ||
* default: `true` | ||
* [X] Better Readme | ||
|
||
* `file-version`: Bats-file version, default to latest | ||
* required: `false` | ||
* default: `0.3.0` | ||
* [ ] Remove sudo in case of bats libs installed in $HOME | ||
|
||
* `file-path`: Bats-file path | ||
* required: `false` | ||
* default: `/usr/lib/bats-file` | ||
* [ ] Add cache for bats libs |