From 124a3443301d2de2d536d6963c4f805b1f96baa3 Mon Sep 17 00:00:00 2001 From: brokenpip3 Date: Sun, 30 Jul 2023 17:48:16 +0200 Subject: [PATCH] Better Readme --- .github/release.yaml | 11 ++ .github/workflows/test-public-action.yaml | 12 +-- README.md | 122 +++++++--------------- 3 files changed, 51 insertions(+), 94 deletions(-) create mode 100644 .github/release.yaml diff --git a/.github/release.yaml b/.github/release.yaml new file mode 100644 index 0000000..7aa8ef7 --- /dev/null +++ b/.github/release.yaml @@ -0,0 +1,11 @@ +changelog: + categories: + - title: 🏕 Features + labels: + - '*' + exclude: + labels: + - dependencies + - title: 👒 Dependencies + labels: + - dependencies diff --git a/.github/workflows/test-public-action.yaml b/.github/workflows/test-public-action.yaml index 01bb1ff..55b61e4 100644 --- a/.github/workflows/test-public-action.yaml +++ b/.github/workflows/test-public-action.yaml @@ -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/setup-bats-libs@0.1.0 with: support-clean: "false" diff --git a/README.md b/README.md index 7fc86ed..af7efb7 100644 --- a/README.md +++ b/README.md @@ -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/setup-bats-libs@0.1.0 - + - name: Setup Bats and bats libs + uses: brokenpip3/setup-bats-libs@1.0.0 ``` -## 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-`) or specify a custom path. -``` yaml -# ... - - name: Setup Bats libs - uses: brokenpip3/setup-bats-libs@0.1.0 - 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/setup-bats-libs@0.1.0 - 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