-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[workflows] add coverage and add badge
- Loading branch information
Showing
4 changed files
with
57 additions
and
2 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: On push | ||
name: Build | ||
|
||
on: | ||
push: | ||
|
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,47 @@ | ||
name: Coverage | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- '.shellspec' | ||
- 'src/*' | ||
- 'tests/*' | ||
workflow_dispatch: | ||
|
||
jobs: | ||
coverage: | ||
name: Run tests coverage | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Docker Buildx | ||
uses: docker/[email protected] | ||
- name: Install shellspec | ||
run: | | ||
mkdir -p ~/shellspec | ||
cd ~/shellspec | ||
git clone https://github.com/shellspec/shellspec.git | ||
ln -s ~/shellspec/shellspec/shellspec /usr/local/bin/shellspec | ||
echo -n "shellspec version: " | ||
shellspec --version | ||
- name: Install kcov | ||
run: | | ||
sudo apt install -y kcov | ||
echo -n "kcov version: " | ||
kcov --version | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
- name: Generate tests coverage reports | ||
run: | | ||
bash shellspec --kcov | ||
- name: Upload reports | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: coverage | ||
path: coverage | ||
- name: Upload coverage reports to Codecov | ||
uses: codecov/codecov-action@v3 | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
|
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
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