From 38734de96bf4218a5b7e8cb170215712e9b6bfdd Mon Sep 17 00:00:00 2001 From: David Anthoff Date: Mon, 23 Sep 2019 13:58:15 -0700 Subject: [PATCH] Turn runtest into buildpkg action --- README.md | 12 +++--------- action.yml | 13 ++----------- lib/main.js | 12 ------------ package-lock.json | 2 +- package.json | 4 ++-- src/main.ts | 16 ---------------- 6 files changed, 8 insertions(+), 51 deletions(-) diff --git a/README.md b/README.md index 762f9c4..dc700d2 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,11 @@ -# julia-runtest Action +# julia-buildpkg 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 build step in a Julia package. ## 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. -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: ``` @@ -34,8 +30,6 @@ jobs: - uses: julia-actions/setup-julia@latest with: version: ${{ matrix.julia-version }} + - uses: julia-actions/julia-buildpkg@master - uses: julia-actions/julia-runtest@master - env: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} - COVERALLS_TOKEN: ${{ secrets.COVERALLS_TOKEN }} ``` diff --git a/action.yml b/action.yml index 828ad91..0c790f8 100644 --- a/action.yml +++ b/action.yml @@ -1,15 +1,6 @@ -name: 'Run Julia package tests' -description: 'Run the tests in a Julia package' +name: 'Run Pkg.build' +description: 'Run the build step in a Julia package' 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: using: 'node12' main: 'lib/main.js' diff --git a/lib/main.js b/lib/main.js index da2b031..763191b 100644 --- a/lib/main.js +++ b/lib/main.js @@ -21,20 +21,8 @@ const exec = __importStar(require("@actions/exec")); function run() { return __awaiter(this, void 0, void 0, function* () { try { - const codecov = core.getInput('codecov'); - const coveralls = core.getInput('coveralls'); // Run Pkg.build yield 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 - yield 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())']) - yield 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())']) - yield 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) { core.setFailed(error.message); diff --git a/package-lock.json b/package-lock.json index 294b30b..bda9c00 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "julia-runtest", + "name": "julia-buildpkg", "version": "0.1.0", "lockfileVersion": 1, "requires": true, diff --git a/package.json b/package.json index be91061..63ff9cc 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "julia-runtest", + "name": "julia-buildpkg", "version": "0.1.0", "private": true, "description": "Julia package test run action", @@ -10,7 +10,7 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/julia-actions/julia-runtest.git" + "url": "git+https://github.com/julia-actions/julia-buildpkg.git" }, "keywords": [ "actions", diff --git a/src/main.ts b/src/main.ts index 87e9d79..fb5367a 100644 --- a/src/main.ts +++ b/src/main.ts @@ -3,24 +3,8 @@ import * as exec from '@actions/exec' async function run() { 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 - 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) { core.setFailed(error.message) }