Remove build and coverage from action

This commit is contained in:
David Anthoff
2019-09-23 14:12:09 -07:00
parent a7eaa22ec9
commit da4330aa40
3 changed files with 1 additions and 33 deletions

View File

@@ -1,15 +1,11 @@
# julia-runtest Action # julia-runtest Action
This action runs the tests in a Julia package and uploads coverage results to [Coveralls](https://coveralls.io/) and [Codecov](https://codecov.io/). This action runs the tests in a Julia package.
## Usage ## Usage
Julia needs to be installed before this action can run. This can easily be achieved with the [setup-julia](https://github.com/marketplace/actions/setup-julia-environment) action. Julia needs to be installed before this action can run. This can easily be achieved with the [setup-julia](https://github.com/marketplace/actions/setup-julia-environment) action.
This action accepts two inpus: `codecov` (with values `true` or `false`) and `coveralls` (with values `true` or `false`). These inputs control whether coverage results are automatically uploaded to the respective service. Both inputs have a default value of `true`.
Uploads to [Coveralls](https://coveralls.io/) or [Codecov](https://codecov.io/) only work if an upload token for the respective service is stored as a Github Actions secret and made available to the action. These tokens need to be stored in the environment variables `CODECOV_TOKEN` and `COVERALLS_TOKEN`.
And example workflow that uses this action might look like this: And example workflow that uses this action might look like this:
``` ```
@@ -35,7 +31,4 @@ jobs:
with: with:
version: ${{ matrix.julia-version }} version: ${{ matrix.julia-version }}
- uses: julia-actions/julia-runtest@master - uses: julia-actions/julia-runtest@master
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
``` ```

View File

@@ -1,15 +1,6 @@
name: 'Run Julia package tests' name: 'Run Julia package tests'
description: 'Run the tests in a Julia package' description: 'Run the tests in a Julia package'
author: 'David Anthoff' author: 'David Anthoff'
inputs:
codecov:
description: 'Coverage results upload to codecov.'
required: false
default: 'true'
coveralls:
description: 'Coverage results upload to coveralls.'
required: false
default: 'true'
runs: runs:
using: 'node12' using: 'node12'
main: 'lib/main.js' main: 'lib/main.js'

View File

@@ -3,24 +3,8 @@ import * as exec from '@actions/exec'
async function run() { async function run() {
try { try {
const codecov = core.getInput('codecov')
const coveralls = core.getInput('coveralls')
// Run Pkg.build
await exec.exec('julia', ['--color=yes', '--project', '-e', 'using Pkg; if VERSION >= v\"1.1.0-rc1\"; Pkg.build(verbose=true); else Pkg.build(); end'])
// Run Pkg.test // Run Pkg.test
await exec.exec('julia', ['--color=yes', '--check-bounds=yes', '--project', '-e', 'using Pkg; Pkg.test(coverage=true)']) await exec.exec('julia', ['--color=yes', '--check-bounds=yes', '--project', '-e', 'using Pkg; Pkg.test(coverage=true)'])
if(codecov=='true') {
// await exec.exec('julia', ['--color=yes', '-e', 'using Pkg; Pkg.add("Coverage"); using Coverage; Codecov.submit(process_folder())'])
await exec.exec('julia', ['--color=yes', '-e', 'using Pkg; Pkg.add(PackageSpec(url="https://github.com/davidanthoff/Coverage.jl.git", rev="githubactions")); using Coverage; Codecov.submit(process_folder())'])
}
if(coveralls=='true') {
// await exec.exec('julia', ['--color=yes', '-e', 'using Pkg; Pkg.add("Coverage"); using Coverage; Coveralls.submit(process_folder())'])
await exec.exec('julia', ['--color=yes', '-e', 'using Pkg; Pkg.add(PackageSpec(url="https://github.com/davidanthoff/Coverage.jl.git", rev="githubactions")); using Coverage; Coveralls.submit(process_folder())'])
}
} catch (error) { } catch (error) {
core.setFailed(error.message) core.setFailed(error.message)
} }