diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 5c5b2cb..6fad861 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -33,28 +33,24 @@ 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 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 }} 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 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