Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 11 additions & 10 deletions .github/actions/build-and-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,35 +23,36 @@ runs:
shell: bash
run: make versions

- name: Stage 1 - Build
- name: Stage 0 - Build Stage 1
shell: bash
run: make BUILD=${{ inputs.build }} -j4

- name: Stage 1 - Print version
shell: bash
run: ./build/cabin version --verbose

- name: Stage 1 - Integration Test
- name: Stage 1 - Test
shell: bash
run: find tests -maxdepth 1 -name '[0-9]*.sh' -print0 | xargs -0 -I {} sh -c 'sh {} -v'
run: |
[[ '${{ inputs.coverage }}' == 'true' ]] && COVERAGE='--coverage'
# shellcheck disable=SC2086
./build/cabin test -vv $COVERAGE
env:
CABIN_TERM_COLOR: auto
CABIN: ${{ github.workspace }}/build/cabin

- name: Stage 2 - Build & Test
- name: Stage 1 - Build Stage 2
shell: bash
run: |
[[ '${{ inputs.build }}' == 'release' ]] && RELEASE='--release'
[[ '${{ inputs.coverage }}' == 'true' ]] && COVERAGE='--coverage'
# shellcheck disable=SC2086
./build/cabin -vv run $RELEASE test -vv $COVERAGE
./build/cabin -vv build $RELEASE

- name: Stage 2 - Print version
shell: bash
run: ./cabin-out/${{ inputs.build }}/cabin version --verbose

- name: Stage 2 - Integration Test
- name: Stage 2 - Test
shell: bash
run: find tests -maxdepth 1 -name '[0-9]*.sh' -print0 | xargs -0 -I {} sh -c 'sh {} -v'
run: ./cabin-out/${{ inputs.build }}/cabin test -vv
env:
CABIN: ${{ github.workspace }}/cabin-out/${{ inputs.build }}/cabin
CABIN_TERM_COLOR: auto
35 changes: 9 additions & 26 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,42 +56,25 @@ Be mindful of when to use structs vs. classes. For guidance, refer to the
### Formatting and Linting

Before submitting a PR, ensure your code adheres to the project's coding
standards by running the following tools:
standards. Also, always validate your changes to ensure they do not
introduce regressions or break existing functionality:

1. Run the linter (`cpplint`)
```bash
cabin lint
./build/cabin lint
```
2. Run the formatter (`clang-format`)
```bash
cabin fmt
./build/cabin fmt
```
3. Run the static analyzer (`clang-tidy`)
```bash
cabin tidy
./build/cabin tidy
```
4. Run tests
```bash
./build/cabin test
```

### Testing

Always validate your changes to ensure they do not introduce regressions or
break existing functionality:

```bash
# Unit tests
cabin test

# Integration tests
wget https://raw.githubusercontent.com/felipec/sharness/refs/tags/v1.2.1/sharness.sh
wget https://raw.githubusercontent.com/felipec/sharness/refs/tags/v1.2.1/lib-sharness/functions.sh
mv sharness.sh tests/
mkdir tests/lib-sharness
mv functions.sh tests/lib-sharness/
prove -j$(nproc) --shuffle tests/[0-9]*.sh
```

Make sure to add new tests for any new functionality you introduce. See
<https://github.com/felipec/sharness/blob/v1.2.1/API.md> for more information on
how to use `sharness`.

### Packaging

Expand Down
3 changes: 3 additions & 0 deletions cabin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ libgit2 = {version = ">=1.7 && <1.10", system = true}
nlohmann_json = {version = "3.10.5", system = true}
tbb = {version = ">=2021.5.0 && <2023.0.0", system = true}

[dev-dependencies]
boost-ut = {git = "https://github.com/boost-ext/ut.git", tag = "v2.3.1"}

[profile]
cxxflags = ["-pedantic-errors", "-Wall", "-Wextra", "-Wpedantic", "-fno-rtti"]

Expand Down
Loading
Loading