Skip to content

Commit

Permalink
initial: github actions, readme
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaHoffmann committed Jul 8, 2023
1 parent efb260b commit a094d9b
Show file tree
Hide file tree
Showing 6 changed files with 115 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Write HCL
2. ???
3. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
15 changes: 15 additions & 0 deletions .github/workflows/acceptance.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: acceptance
on: [pull_request]

jobs:
unittests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: cachix/[email protected]
with:
nix_path: nixpkgs=channel:nixos-unstable
- uses: dx-oss/nix-shell-action@v11
with:
file: shell.nix
script: tree-sitter test
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# tree-sitter-promql

tree-sitter grammar for the [promql](https://prometheus.io/docs/prometheus/latest/querying/basics/) language

## Developing

It is recommended to use `nix` to fulfill all development dependencies. To activate the development environment simply run `nix-shell` in the project root.

## Running Tests

To run tests simply run `nix-shell --run 'tree-sitter test'`.
12 changes: 12 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
let
pkgs = import <nixpkgs> { };
in
pkgs.mkShell {
name = "env";
buildInputs = with pkgs; [
nodejs
tree-sitter
emscripten
];
}

31 changes: 31 additions & 0 deletions test/corpus/binary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,34 @@ foo - bar
(metric_name))
(instant_vector_selector
(metric_name))))

================================================================================
binary - error rate
================================================================================

(sum(rate(http_requests_total{status_code=~"5.*"}[5m]))/sum(rate(http_requests_total[5m])))

--------------------------------------------------------------------------------

(query
(binary_expression
(aggregation_expression
(aggregation_operator)
(function_call
(function_name)
(function_args
(range_vector_selector
(metric_name)
(label_selectors
(label_matcher
(label_name)
(label_value)))
(range_selection)))))
(aggregation_expression
(aggregation_operator)
(function_call
(function_name)
(function_args
(range_vector_selector
(metric_name)
(range_selection)))))))

0 comments on commit a094d9b

Please sign in to comment.