├── .github ├── CODEOWNERS ├── dependabot.yml └── workflows │ └── backup.yml ├── LICENSE ├── README.md ├── action.yml └── main.jl /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @julia-actions/reviewers 2 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 5 | 6 | version: 2 7 | updates: 8 | # Keep dependencies for GitHub Actions up-to-date 9 | - package-ecosystem: 'github-actions' 10 | directory: '/' 11 | schedule: 12 | interval: 'daily' 13 | -------------------------------------------------------------------------------- /.github/workflows/backup.yml: -------------------------------------------------------------------------------- 1 | name: Backup 2 | 3 | on: 4 | schedule: 5 | - cron: '5 4 * * 0' 6 | 7 | workflow_dispatch: 8 | 9 | jobs: 10 | backup: 11 | runs-on: ubuntu-20.04 12 | 13 | steps: 14 | - name: Configure cache 15 | uses: actions/cache@v3 16 | with: 17 | path: | 18 | ${{ env.GITHUB_WORKSPACE }} 19 | ~/.cache/restic 20 | key: ${{ runner.os }} 21 | 22 | - name: Install the correct Python version 23 | uses: actions/setup-python@v5 24 | with: 25 | python-version: '3.x' 26 | 27 | - name: Run backup action 28 | uses: julia-actions/restic-action@main 29 | env: # Options: https://restic.readthedocs.io/en/latest/040_backup.html#environment-variables 30 | RESTIC_REPOSITORY: b2:${{ secrets.B2_BUCKET }}:${{ github.repository }} 31 | RESTIC_PASSWORD: ${{ secrets.RESTIC_PASSWORD }} 32 | B2_ACCOUNT_ID: ${{ secrets.B2_ACCOUNT_ID }} 33 | B2_ACCOUNT_KEY: ${{ secrets.B2_ACCOUNT_KEY }} 34 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018-2020 GitHub, Inc., David Anthoff and contributors 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
4 | 5 | ## Usage 6 | 7 | See [PkgTemplates.jl](https://github.com/invenia/PkgTemplates.jl/blob/master/test/fixtures/AllPlugins/.github/workflows/CI.yml) for a complete example. 8 | 9 | ```yaml 10 | 11 | - uses: julia-actions/julia-processcoverage@v1 12 | - uses: codecov/codecov-action@v2 13 | with: 14 | files: lcov.info 15 | ``` 16 | 17 | One can also specify the directory or directories (comma separated) to use via the `directories` input (which defaults to `src,ext`). E.g. 18 | ```yaml 19 | 20 | - uses: julia-actions/julia-processcoverage@v1 21 | with: 22 | directories: src,ext,examples 23 | - uses: codecov/codecov-action@v2 24 | with: 25 | files: lcov.info 26 | ``` 27 | instructs the action to look for coverage information in `src`, `ext`, and an `examples` folder. Likewise, use 28 | ```yaml 29 | - uses: julia-actions/julia-processcoverage@v1 30 | with: 31 | directories: path/to/subdir/package/src 32 | - uses: codecov/codecov-action@v2 33 | with: 34 | files: lcov.info 35 | ``` 36 | to get coverage information from a package in a subdirectory of the repo. 37 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: 'Process Julia coverage files' 2 | description: 'Convert Julia coverage files into a lcov file' 3 | author: 'David Anthoff' 4 | 5 | branding: 6 | icon: 'settings' 7 | color: 'gray-dark' 8 | 9 | inputs: 10 | directories: 11 | description: 'Comma-separated list of directories to look for coverage information (e.g. `src,examples`)' 12 | required: false 13 | default: 'src,ext' 14 | 15 | runs: 16 | using: 'composite' 17 | steps: 18 | - run: julia --color=yes "$GITHUB_ACTION_PATH"/main.jl 19 | shell: bash 20 | env: 21 | INPUT_DIRECTORIES: ${{ inputs.directories }} 22 | -------------------------------------------------------------------------------- /main.jl: -------------------------------------------------------------------------------- 1 | using Pkg 2 | 3 | Pkg.activate("coveragetempenv", shared=true) 4 | 5 | Pkg.add(PackageSpec(name="CoverageTools")) 6 | 7 | using CoverageTools 8 | 9 | directories = get(ENV, "INPUT_DIRECTORIES", "src,ext") 10 | dirs = filter!(!isempty, strip.(split(directories, ","))) 11 | for dir in dirs 12 | if dir == "ext" 13 | continue # Silently skip this directory 14 | elseif !isdir(dir) 15 | error("directory \"$dir\" not found!") 16 | end 17 | end 18 | filter!(isdir, dirs) 19 | pfs = mapreduce(process_folder, vcat, dirs) 20 | LCOV.writefile("lcov.info", pfs) 21 | --------------------------------------------------------------------------------