Skip to content

Commit

Permalink
Merge pull request #63 from awadell1/awadell1/issue47
Browse files Browse the repository at this point in the history
Add a github action for PkgJogger
  • Loading branch information
awadell1 authored Jul 6, 2022
2 parents 9ce363b + 4d1b177 commit 54c03c2
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 18 deletions.
28 changes: 12 additions & 16 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
30 changes: 30 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 4 additions & 2 deletions docs/src/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down

2 comments on commit 54c03c2

@awadell1
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/63779

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.4.0 -m "<description of version>" 54c03c2d0b685bed6466f7d3763518108944bad7
git push origin v0.4.0

Please sign in to comment.