Skip to content

Commit

Permalink
Merge pull request #29 from Herb-AI/package
Browse files Browse the repository at this point in the history
Package
  • Loading branch information
nicolaefilat authored Jul 10, 2023
2 parents 0914379 + 950fb7b commit e234ed9
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 4 deletions.
13 changes: 11 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
name = "HerbGrammar"
uuid = "4ef9e186-2fe5-4b24-8de7-9f7291f24af7"
authors = ["Sebastijan Dumancic <[email protected]>", "Jaap de Jong <[email protected]>"]
authors = ["Sebastijan Dumancic <[email protected]>", "Jaap de Jong <[email protected]>", "Nicolae Filat <[email protected]>", "Piotr Cichoń <[email protected]>"]
version = "0.1.0"

[deps]
AbstractTrees = "1520ce14-60c1-5f80-bbc7-55ef81b5835c"
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
TreeView = "39424ebd-4cf3-5550-a685-96706a953f40"
HerbCore = "2b23ba43-8213-43cb-b5ea-38c12b45bd45"

[compat]
AbstractTrees = "0.4"
DataStructures = "0.17,0.18"
TreeView = "0.5"
julia = "1"
HerbCore = "0.1.0"
julia = "1.8"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Grammar.jl
[![Build Status](https://github.com/Herb-AI/HerbGrammar.jl/actions/workflows/CI.yml/badge.svg?branch=master)](https://github.com/Herb-AI/HerbGrammar.jl/actions/workflows/CI.yml?query=branch%3Amaster)

This package contains functionality for declaring grammars for the Herb Program Synthesis framework.

Expand All @@ -8,3 +9,7 @@ To use this project, initialize the project with
```shell
julia --project=. -e 'using Pkg; Pkg.instantiate()'
```




2 changes: 1 addition & 1 deletion src/HerbGrammar.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ using StatsBase
using DataStructures # NodeRecycler
using Serialization # grammar_io

using ..HerbCore
using HerbCore

include("grammar_base.jl")
include("rulenode_operators.jl")
Expand Down
1 change: 0 additions & 1 deletion src/sampling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ mutable struct RuleNodeAndCount
node::RuleNode
cnt::Int
end

"""
sample(root::RuleNode, typ::Symbol, grammar::Grammar, maxdepth::Int=typemax(Int))
Expand Down
7 changes: 7 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
using HerbGrammar
using Test

@testset "HerbGrammar.jl" verbose=true begin
include("test_cfg.jl")
include("test_csg.jl")
end
35 changes: 35 additions & 0 deletions workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CI
on:
push:
branches:
- master
tags: ['*']
pull_request:
concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1.8'
- 'nightly'
os:
- ubuntu-latest
arch:
- x64
steps:
- uses: actions/checkout@v3
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v1
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
16 changes: 16 additions & 0 deletions workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: CompatHelper
on:
schedule:
- cron: 0 0 * * *
workflow_dispatch:
jobs:
CompatHelper:
runs-on: ubuntu-latest
steps:
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
run: julia -e 'using CompatHelper; CompatHelper.main()'
31 changes: 31 additions & 0 deletions workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: TagBot
on:
issue_comment:
types:
- created
workflow_dispatch:
inputs:
lookback:
default: 3
permissions:
actions: read
checks: read
contents: write
deployments: read
issues: read
discussions: read
packages: read
pages: read
pull-requests: read
repository-projects: read
security-events: read
statuses: read
jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
runs-on: ubuntu-latest
steps:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
ssh: ${{ secrets.DOCUMENTER_KEY }}

2 comments on commit e234ed9

@nicolaefilat
Copy link
Contributor 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/87165

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.1.0 -m "<description of version>" e234ed9a575f1a6c660c4b2cc28c964a7c4f1e7b
git push origin v0.1.0

Please sign in to comment.