Skip to content

Commit

Permalink
Merge pull request #64 from awadell1/fix-github-action-recipe
Browse files Browse the repository at this point in the history
Fix GitHub Action recipe
  • Loading branch information
awadell1 authored Aug 24, 2022
2 parents 54c03c2 + 0aafbf4 commit 0b874d1
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 13 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ jobs:
fail-fast: false
matrix:
version:
- '1' # Latest v1 release
- '1.6' # Current LTS version
- nightly
- '*' # Latest Release
- '~1.6' # Current LTS
os:
- ubuntu-latest
- windows-latest
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
types:
- created
workflow_dispatch:
permissions:
contents: write
jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/tag-latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Add latest tag to new release
on:
release:
types: [published]

jobs:
run:
name: Run local action
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Run latest-tag
uses: EndBug/latest-tag@8b12061830221b438839f7048d1320ac353926aa
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "PkgJogger"
uuid = "10150987-6cc1-4b76-abee-b1c1cbd91c01"
authors = ["Alexius Wadell <[email protected]> and contributors"]
version = "0.4.0"
version = "0.4.1"

[deps]
BSON = "fbb218c0-5317-5bc6-957e-2ee96dd4b1f0"
Expand Down
21 changes: 16 additions & 5 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,23 @@ inputs:
runs:
using: composite
steps:
- id: install_pkgjogger
run: julia --color=yes --eval
- name: 🏃 Install PkgJogger
id: install_pkgjogger
run: >
PKG_JOGGER_ENV=$(mktemp --directory);
echo "::set-output name=env::$(echo $PKG_JOGGER_ENV)";
julia --color=yes --project="$PKG_JOGGER_ENV" --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()'
- name: ⏱ Run Benchmarks
id: run_benchmarks
run: >
${{ inputs.prefix }} julia --project="${{ steps.install_pkgjogger.outputs.env }}" --color=yes
${{ inputs.options }} --eval 'using PkgJogger; PkgJogger.ci()'
shell: bash

- name: 🧹 Cleanup PkgJogger
id: Cleanup
run: rm -rf "${{ steps.install_pkgjogger.outputs.env }}"
shell: bash
8 changes: 4 additions & 4 deletions docs/src/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@latest
- uses: awadell1/PkgJogger
- uses: awadell1/PkgJogger.jl@latest
- uses: actions/upload-artifact@v2
with:
name: benchmarks
Expand All @@ -37,9 +37,9 @@ jobs:
PkgJogger will create a temporary environment with the following:

1) Activate a temporary Julia environment for benchmarking.
- If a Julia project file exists in `benchmark/`, it will be copied to the
temporary environment. Manifest files are currently ignored.
- Otherwise, an empty environment is created.
- If a Julia project file exists in `benchmark/`, it will be copied to the
temporary environment. Manifest files are currently ignored.
- Otherwise, an empty environment is created.
2) Add the current project (via `Pkg.develop`) to the benchmarking environment
and resolve dependencies using
[`PRESEVE_NONE`](https://pkgdocs.julialang.org/v1/api/#Pkg.add).
Expand Down
1 change: 1 addition & 0 deletions src/ci.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ function sandbox(f, pkg)
self = PackageSpec(
name = JOGGER_PKGS[1].name,
uuid = JOGGER_PKGS[1].uuid,
path = Base.pkgdir(PkgJogger),
)

# Locate benchmark project
Expand Down

2 comments on commit 0b874d1

@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/66953

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.1 -m "<description of version>" 0b874d1094feb9ad9860b7e420c9853aa53b5082
git push origin v0.4.1

Please sign in to comment.