From 59328820d61ecbb92a381745117beb36845f1ee3 Mon Sep 17 00:00:00 2001 From: Alexius Wadell Date: Tue, 5 Jul 2022 20:53:11 -0400 Subject: [PATCH 1/3] First pass at providing a Github Action --- .github/workflows/CI.yml | 11 +++++++++++ action.yml | 30 ++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 action.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 5c5b2cb..60bc2aa 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -33,6 +33,17 @@ jobs: env: COVERALLS_TOKEN: ${{ secrets.GITHUB_TOKEN }} + action: + name: Test Github action + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: julia-actions/setup-julia@v1 + - uses: julia-actions/cache@v1 + - uses: "./" + with: + prefix: "cd test/Example.jl &&" + docs: name: Documentation runs-on: ubuntu-latest diff --git a/action.yml b/action.yml new file mode 100644 index 0000000..cf65b0d --- /dev/null +++ b/action.yml @@ -0,0 +1,30 @@ +name: "Run Julia Benchmarks" +description: "Takes your packages for a jog by running it's Benchmarks" +author: "Alexius Wadell" + +branding: + icon: activity + color: purple + +inputs: + prefix: + description: "Prefix to be inserted before the julia command" + default: "" + required: false + options: + description: "Additional command line flags to pass to the julia command. e.g. `-O3`" + default: "" + required: false + +runs: + using: composite + steps: + - id: install_pkgjogger + run: julia --color=yes --eval + 'using Pkg; Pkg.develop(name="PkgJogger", path="${{ github.action_path }}")' + shell: bash + + - id: run_benchmarks + run: ${{ inputs.prefix }} julia --color=yes ${{ inputs.options }} --eval + 'using Pkg, PkgJogger; PkgJogger.ci()' + shell: bash From 4f0ad9f43637e0d9b410a5e7a11fc929f7fe41e6 Mon Sep 17 00:00:00 2001 From: Alexius Wadell Date: Tue, 5 Jul 2022 21:19:32 -0400 Subject: [PATCH 2/3] Update docs to use github action --- docs/src/ci.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/src/ci.md b/docs/src/ci.md index ca063b4..217dd8c 100644 --- a/docs/src/ci.md +++ b/docs/src/ci.md @@ -9,6 +9,9 @@ julia -e 'using Pkg; Pkg.add("PkgJogger"); using PkgJogger; PkgJogger.ci()' ## Github Actions +Just add `uses: awadell1/PkgJogger` and you're set! For example, the following +will setup julia, run the benchmarks and upload the results for later analysis: + ```yaml name: PkgJogger on: @@ -21,8 +24,7 @@ jobs: steps: - uses: actions/checkout@v2 - uses: julia-actions/setup-julia@latest - - name: Run Benchmarks - run: julia -e 'using Pkg; Pkg.add("PkgJogger"); using PkgJogger; PkgJogger.ci()' + - uses: awadell1/PkgJogger - uses: actions/upload-artifact@v2 with: name: benchmarks From 4d1b1771c2152dbbd64ea28e0dfa8ccdfb02622e Mon Sep 17 00:00:00 2001 From: Alexius Wadell Date: Tue, 5 Jul 2022 21:35:47 -0400 Subject: [PATCH 3/3] Simplify the docs workflow Installing and instantiating is handled by the make.jl script --- .github/workflows/CI.yml | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 60bc2aa..6fad861 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -49,23 +49,8 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 + - uses: julia-actions/cache@v1 - uses: julia-actions/setup-julia@v1 - with: - version: '1' - - run: | - julia --project=docs -e ' - using Pkg - Pkg.develop([ - PackageSpec(path=pwd()), - PackageSpec(path=joinpath(pwd(), "test", "Example.jl")) - ]) - Pkg.instantiate()' - - run: | - julia --project=docs -e ' - using Documenter: DocMeta, doctest - using PkgJogger - DocMeta.setdocmeta!(PkgJogger, :DocTestSetup, :(using PkgJogger); recursive=true) - doctest(PkgJogger)' - run: julia --project=docs docs/make.jl env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}