Skip to content

Creating cpp-linter reusable workflows #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
shenxianpeng opened this issue Feb 18, 2024 · 1 comment · Fixed by #15
Closed

Creating cpp-linter reusable workflows #14

shenxianpeng opened this issue Feb 18, 2024 · 1 comment · Fixed by #15
Assignees
Labels
enhancement New feature or request

Comments

@shenxianpeng
Copy link
Contributor

I really like what you did in https://github.com/nRF24/.github/tree/main/.github/workflows to use reusable workflows

I would also like to try to move some common workflows to .github repo

@shenxianpeng shenxianpeng added the enhancement New feature or request label Feb 18, 2024
@shenxianpeng shenxianpeng self-assigned this Feb 18, 2024
@2bndy5
Copy link
Contributor

2bndy5 commented Feb 18, 2024

Ideas for reusable workflows

  • sphinx.yml
  • mkdocs.yml (currently used by only cpp-linter-action repo)
  • publish_pypi.yml
  • pre_commit.yml
  • coverage.yml
    • for uploading reports only, not running tests. Prefer using artifacts to save coverage data that we can use in uploading coverage reports.
          steps:
            - uses: actions/checkout@v4
      
            - name: Download all artifacts
              uses: actions/download-artifact@v4
              with:
                path: ci-artifacts
                pattern: coverage-data-*
      
            - run: mv ci-artifacts/**/.coverage* ./
      
            - name: Setup python
              uses: actions/setup-python@v5
              with:
                python-version: '3.x'
      
            - name: Create coverage report
              run: |
                pip3 install coverage[toml]
                coverage combine
                coverage html
      
            - name: Upload comprehensive coverage HTML report
              uses: actions/upload-artifact@v4
              with:
                name: coverage-report
                path: htmlcov/
      
            - run: coverage report && coverage xml
      
            - uses: codecov/codecov-action@v4
              env:
                CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
              with:
                files: ./coverage.xml
                fail_ci_if_error: true # optional (default = false)
                verbose: true # optional (default = false)

Unfortunately, I don't think unit testing would fit well into a reusable workflow. Testing usually involves some software-specific setup in CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants