Skip to content

Commit

Permalink
Merge pull request #105 from ssciwr/github-actions-linting
Browse files Browse the repository at this point in the history
Add actionlint to pre-commit - a linter for GitHub Action workflow files
  • Loading branch information
dokempf authored Feb 8, 2024
2 parents 5298564 + 44f63c4 commit 1c24c50
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
18 changes: 9 additions & 9 deletions {{cookiecutter.project_slug}}/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,21 +79,21 @@ jobs:
{%- endif %}

- name: make build directory
run: cmake -E make_directory ${{ "{{runner.workspace}}" }}/build
run: cmake -E make_directory ${{ "{{ github.workspace }}" }}/build

- name: configure cmake
shell: bash
working-directory: ${{ "{{runner.workspace}}" }}/build
working-directory: ${{ "{{ github.workspace }}" }}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Debug -DBUILD_DOCS=OFF

- name: build
shell: bash
working-directory: ${{ "{{runner.workspace}}" }}/build
working-directory: ${{ "{{ github.workspace }}" }}/build
run: cmake --build .

- name: run tests
shell: bash
working-directory: ${{ "{{runner.workspace}}" }}/build
working-directory: ${{ "{{ github.workspace }}" }}/build
run: ctest
{%- if cookiecutter.python_bindings == "Yes" %}
python-testing:
Expand Down Expand Up @@ -183,26 +183,26 @@ jobs:
{%- endif %}

- name: make build directory
run: cmake -E make_directory ${{ "{{runner.workspace}}" }}/build
run: cmake -E make_directory ${{ "{{ github.workspace }}" }}/build

- name: configure cmake
shell: bash
working-directory: ${{ "{{runner.workspace}}" }}/build
working-directory: ${{ "{{ github.workspace }}" }}/build
run: cmake $GITHUB_WORKSPACE -DCMAKE_CXX_FLAGS="--coverage" -DBUILD_DOCS=OFF

- name: build
shell: bash
working-directory: ${{ "{{runner.workspace}}" }}/build
working-directory: ${{ "{{ github.workspace }}" }}/build
run: cmake --build .

- name: run tests
shell: bash
working-directory: ${{ "{{runner.workspace}}" }}/build
working-directory: ${{ "{{ github.workspace }}" }}/build
run: ctest

- name: collect coverage report
shell: bash
working-directory: ${{ "{{runner.workspace}}" }}
working-directory: ${{ "{{ github.workspace }}" }}
run: |
lcov --directory ./build{% if cookiecutter.header_only == "No" %}/src{% endif %} --capture --output-file coverage.info
Expand Down
8 changes: 8 additions & 0 deletions {{cookiecutter.project_slug}}/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,11 @@ repos:
hooks:
- id: cmake-format
- id: cmake-lint
{%- if cookiecutter.github_actions_ci == "Yes" %}

# GitHub Actions Workflow linter
- repo: https://github.com/rhysd/actionlint
rev: v1.6.25
hooks:
- id: actionlint
{%- endif %}

0 comments on commit 1c24c50

Please sign in to comment.