Skip to content

Commit

Permalink
Merge branch 'main' into fix-test-doubles
Browse files Browse the repository at this point in the history
  • Loading branch information
khru committed Oct 17, 2024
2 parents 613c242 + 0f8c3e5 commit 0134264
Show file tree
Hide file tree
Showing 154 changed files with 5,724 additions and 1,282 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,5 @@ indent_size = 2
[{Makefile,**.mk,.git*}]
indent_style = tab

[{tests/acceptance/**.sh,src/console_header.sh}]
[{tests/acceptance/**.sh,src/console_header.sh,docs/command-line.md}]
indent_size = unset
20 changes: 14 additions & 6 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
SHOW_HEADER=
HEADER_ASCII_ART=
SIMPLE_OUTPUT=
STOP_ON_FAILURE=
SHOW_EXECUTION_TIME=
DEFAULT_PATH=
BASHUNIT_DEFAULT_PATH=
BASHUNIT_DEV_LOG=
BASHUNIT_BOOTSTRAP=
BASHUNIT_LOG_JUNIT=
BASHUNIT_REPORT_HTML=

# Booleans
BASHUNIT_PARALLEL_RUN=
BASHUNIT_SHOW_HEADER=
BASHUNIT_HEADER_ASCII_ART=
BASHUNIT_SIMPLE_OUTPUT=
BASHUNIT_STOP_ON_FAILURE=
BASHUNIT_SHOW_EXECUTION_TIME=
BASHUNIT_DEV_MODE=
30 changes: 29 additions & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,33 @@ this will require to have installed [fswatcher](https://github.com/emcrisostomo/
make test/watch
```

### Testing different OS

- Linux
- Ubuntu latest
- Alpine latest
- Windows latest
- MacOS latest

#### Docker

##### Ubuntu latest

```bash
docker run --rm -it -v "$(pwd)":/project -w /project ubuntu:latest \
sh -c "apt-get update && \
apt-get install -y bash make shellcheck git curl perl && make test"
```

##### Alpine latest

```bash
make test/alpine
# or
docker run --rm -it -v "$(pwd)":/project -w /project alpine:latest \
sh -c "apk add bash make shellcheck git && make test"
```

## Coding Guidelines

### ShellCheck
Expand Down Expand Up @@ -116,7 +143,8 @@ make pre_commit/install
[Shell Guide](https://google.github.io/styleguide/shellguide.html#s7.2-variable-names) by Google Conventions.

### Documentation
For us the documentation its really important, we are a small group and we want to mantain this project for long, to do that we will need your help

For us the documentation it's really important, we are a small group, and we want to maintain this project for long, to do that we will need your help.

## ADR
If you want to change something related to the architecture or apply a change that it's a decision on how the library works please use [ADR](https://adr.github.io/) otherwise we will request you to do so on the PR.
Expand Down
23 changes: 13 additions & 10 deletions .github/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
This is a guide to know the steps to create a new release.

1. Update the version in [BASHUNIT_VERSION](../bashunit)
2. Update the version in [LATEST_BASHUNIT_VERSION](../install.sh)
3. Update the version in [CHANGELOG.md](../CHANGELOG.md)
4. Update the version in [package.json](../package.json)
5. Create a [new release](https://github.com/TypedDevs/bashunit/releases/new) from GitHub
6. Attach the latest executable to the release
1. Generate a new bashunit with `build.sh`
2. Attach the generated file to the release page on GitHub
3. Keep the name `bashunit`
7. Commit and push
8. Rebase `latest` branch from the new created tag and push
1. Update the version in [LATEST_BASHUNIT_VERSION](../install.sh)
1. Update the version in [CHANGELOG.md](../CHANGELOG.md)
1. Update the version in [package.json](../package.json)
1. Build the project `./build.sh bin`
1. This will generate `bin/bashunit` and `bin/checksum`
1. Update the checksum(sha256) in [package.json](../package.json)
1. Create a [new release](https://github.com/TypedDevs/bashunit/releases/new) from GitHub
1. Attach the latest executable and checksum to the release
1. `bin/bashunit`
1. `bin/checksum`
1. Keep the same name
1. Commit and push
1. Rebase `latest` branch from the newly created tag and push
1. This will trigger "build and deploy" the docs
21 changes: 9 additions & 12 deletions .github/workflows/check-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@ name: Check Docs

on:
pull_request:
push:
branches:
- main

workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: pages
cancel-in-progress: false
Expand All @@ -19,19 +17,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- name: Setup Pages
uses: actions/configure-pages@v3

- name: Install dependencies
run: npm ci

- name: Build with VitePress
run: |
npm run docs:build
touch docs/.vitepress/dist/.nojekyll
run: npm run docs:build
54 changes: 0 additions & 54 deletions .github/workflows/deploy-docs.yml

This file was deleted.

25 changes: 14 additions & 11 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
name: Editorconfig Linter

on:
pull_request:
push:
branches:
- main

name: Editorconfig Linter

jobs:

tests:
linter:
name: "Run Lint on ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ 'ubuntu-latest' ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: editorconfig-checker/action-editorconfig-checker@main
- run: editorconfig-checker
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Editorconfig Linter
uses: editorconfig-checker/action-editorconfig-checker@main

- name: Run Linter
run: editorconfig-checker

45 changes: 45 additions & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Publish Docs

on:
push:
branches:
- latest

workflow_dispatch:

concurrency:
group: pages
cancel-in-progress: false

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm

- name: Install dependencies
run: npm ci

- name: Build with VitePress
run: npm run docs:build

- name: Publish to Cloudflare Pages
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ secrets.CLOUDFLARE_PROJECT_NAME }}
directory: docs/.vitepress/dist
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
15 changes: 9 additions & 6 deletions .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
name: Static Analysis

on:
pull_request:
push:
branches:
- main

name: Static analysis

jobs:

shellcheck:
name: ShellCheck
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ 'ubuntu-latest', 'macos-latest' ]
os:
- ubuntu-latest
- macos-latest
steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Run ShellCheck
uses: ludeeus/action-shellcheck@master
env:
Expand Down
Loading

0 comments on commit 0134264

Please sign in to comment.