15 Commits

Author SHA1 Message Date
dependabot[bot]
ea5e0fc691 Bump actions/cache from 3 to 5 (#30)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-12-12 16:23:53 -05:00
abhro
ecc9c01653 Update README.md (#28)
* Remove unavailable badge from README.md

* Add title to README.md

* Suggest using newer `codecov/codecov-action` in README.md
2025-10-18 20:14:25 -04:00
dependabot[bot]
51178d2d1c Bump actions/setup-python from 4 to 5 (#24)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-06 16:57:30 -05:00
Arno Strouwen
32c9a92ffc strip whitespace (#18)
Co-authored-by: Viral B. Shah <ViralBShah@users.noreply.github.com>
2023-11-21 22:24:08 -05:00
dependabot[bot]
de15ca79be Bump actions/cache from 2 to 3 (#22)
Bumps [actions/cache](https://github.com/actions/cache) from 2 to 3.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-21 22:23:34 -05:00
dependabot[bot]
0d1581b1d9 Bump actions/setup-python from 2 to 4 (#23)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2 to 4.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v2...v4)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-21 22:23:15 -05:00
Ian Butterworth
3c74a1a7cd Create dependabot.yml (#21) 2023-11-21 22:21:24 -05:00
Oscar Dowson
03114f09f1 Fix when input directories are not found (#20)
* Fix when input directories are not found

* Update main.jl

Co-authored-by: Ian Butterworth <i.r.butterworth@gmail.com>

Co-authored-by: Ian Butterworth <i.r.butterworth@gmail.com>
2022-12-21 20:01:07 -05:00
Fredrik Ekre
605cc6b85a RFC: change default directory to src,ext. (#19) 2022-12-21 23:56:53 +01:00
Curtis Vogt
6e018a9646 Use codecov-action@v2 in examples (#11) 2021-10-26 16:35:58 +02:00
Jim Garrison
a89a6dbd45 Update README link to PkgTemplates.jl (#10)
The target file was renamed in https://github.com/invenia/PkgTemplates.jl/pull/252
2021-10-01 10:08:13 +02:00
Eric Hanson
52227d0278 Add directories input (#8)
Co-authored-by: Sascha Mann <git@mail.saschamann.eu>
Co-authored-by: Michael Schlottke-Lakemper <michael@sloede.com>
2021-06-05 12:04:57 +02:00
Sascha Mann
f555f2b0e5 Add automated backup workflow (#7) 2020-12-19 14:45:37 +01:00
Sascha Mann
40c067cf87 Make the @julia-actions/reviewers the global code owners for this repo 2020-12-14 14:35:01 +01:00
Amin Yahyaabadi
6cb1ebb8b8 Add README (#5) 2020-08-14 15:02:09 +02:00
6 changed files with 96 additions and 97 deletions

1
.github/CODEOWNERS vendored Normal file
View File

@@ -0,0 +1 @@
* @julia-actions/reviewers

12
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,12 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
# Keep dependencies for GitHub Actions up-to-date
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'daily'

33
.github/workflows/backup.yml vendored Normal file
View File

@@ -0,0 +1,33 @@
name: Backup
on:
schedule:
- cron: '5 4 * * 0'
workflow_dispatch:
jobs:
backup:
runs-on: ubuntu-20.04
steps:
- name: Configure cache
uses: actions/cache@v5
with:
path: |
${{ env.GITHUB_WORKSPACE }}
~/.cache/restic
key: ${{ runner.os }}
- name: Install the correct Python version
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Run backup action
uses: julia-actions/restic-action@main
env: # Options: https://restic.readthedocs.io/en/latest/040_backup.html#environment-variables
RESTIC_REPOSITORY: b2:${{ secrets.B2_BUCKET }}:${{ github.repository }}
RESTIC_PASSWORD: ${{ secrets.RESTIC_PASSWORD }}
B2_ACCOUNT_ID: ${{ secrets.B2_ACCOUNT_ID }}
B2_ACCOUNT_KEY: ${{ secrets.B2_ACCOUNT_KEY }}

124
README.md
View File

@@ -1,101 +1,37 @@
<p align="center"> # `julia-actions/julia-processcoverage` Action
<a href="https://github.com/actions/typescript-action/actions"><img alt="typescript-action status" src="https://github.com/actions/typescript-action/workflows/build-test/badge.svg"></a>
</p>
# Create a JavaScript Action using TypeScript ## Usage
Use this template to bootstrap the creation of a JavaScript action.:rocket: See [PkgTemplates.jl](https://github.com/invenia/PkgTemplates.jl/blob/master/test/fixtures/AllPlugins/.github/workflows/CI.yml) for a complete example.
This template includes compilication support, tests, a validation workflow, publishing, and versioning guidance.
If you are new, there's also a simpler introduction. See the [Hello World JavaScript Action](https://github.com/actions/hello-world-javascript-action)
## Create an action from this template
Click the `Use this Template` and provide the new repo details for your action
## Code in Master
Install the dependencies
```bash
$ npm install
```
Build the typescript and package it for distribution
```bash
$ npm run build && npm run pack
```
Run the tests :heavy_check_mark:
```bash
$ npm test
PASS ./index.test.js
✓ throws invalid number (3ms)
wait 500 ms (504ms)
test runs (95ms)
...
```
## Change action.yml
The action.yml contains defines the inputs and output for your action.
Update the action.yml with your name, description, inputs and outputs for your action.
See the [documentation](https://help.github.com/en/articles/metadata-syntax-for-github-actions)
## Change the Code
Most toolkit and CI/CD operations involve async operations so the action is run in an async function.
```javascript
import * as core from '@actions/core';
...
async function run() {
try {
...
}
catch (error) {
core.setFailed(error.message);
}
}
run()
```
See the [toolkit documentation](https://github.com/actions/toolkit/blob/master/README.md#packages) for the various packages.
## Publish to a distribution branch
Actions are run from GitHub repos so we will checkin the packed dist folder.
Then run [ncc](https://github.com/zeit/ncc) and push the results:
```bash
$ npm run pack
$ git add dist
$ git commit -a -m "prod dependencies"
$ git push origin releases/v1
```
Your action is now published! :rocket:
See the [versioning documentation](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md)
## Validate
You can now validate the action by referencing `./` in a workflow in your repo (see [test.yml](.github/workflows/test.yml)])
```yaml ```yaml
uses: ./
with: - uses: julia-actions/julia-processcoverage@v1
milliseconds: 1000 - uses: codecov/codecov-action@v5
with:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
``` ```
See the [actions tab](https://github.com/actions/javascript-action/actions) for runs of this action! :rocket: One can also specify the directory or directories (comma separated) to use via the `directories` input (which defaults to `src,ext`). E.g.
```yaml
## Usage: - uses: julia-actions/julia-processcoverage@v1
with:
After testing you can [create a v1 tag](https://github.com/actions/toolkit/blob/master/docs/action-versioning.md) to reference the stable and latest V1 action directories: src,ext,examples
- uses: codecov/codecov-action@v5
with:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
```
instructs the action to look for coverage information in `src`, `ext`, and an `examples` folder. Likewise, use
```yaml
- uses: julia-actions/julia-processcoverage@v1
with:
directories: path/to/subdir/package/src
- uses: codecov/codecov-action@v5
with:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
```
to get coverage information from a package in a subdirectory of the repo.

View File

@@ -6,8 +6,16 @@ branding:
icon: 'settings' icon: 'settings'
color: 'gray-dark' color: 'gray-dark'
inputs:
directories:
description: 'Comma-separated list of directories to look for coverage information (e.g. `src,examples`)'
required: false
default: 'src,ext'
runs: runs:
using: 'composite' using: 'composite'
steps: steps:
- run: julia --color=yes "$GITHUB_ACTION_PATH"/main.jl - run: julia --color=yes "$GITHUB_ACTION_PATH"/main.jl
shell: bash shell: bash
env:
INPUT_DIRECTORIES: ${{ inputs.directories }}

15
main.jl
View File

@@ -6,6 +6,15 @@ Pkg.add(PackageSpec(name="CoverageTools"))
using CoverageTools using CoverageTools
pf = process_folder() directories = get(ENV, "INPUT_DIRECTORIES", "src,ext")
dirs = filter!(!isempty, strip.(split(directories, ",")))
LCOV.writefile("lcov.info", pf) for dir in dirs
if dir == "ext"
continue # Silently skip this directory
elseif !isdir(dir)
error("directory \"$dir\" not found!")
end
end
filter!(isdir, dirs)
pfs = mapreduce(process_folder, vcat, dirs)
LCOV.writefile("lcov.info", pfs)