mirror of https://github.com/mickael-menu/zk
Compare commits
No commits in common. 'main' and 'v0.14.0' have entirely different histories.
@ -1,43 +0,0 @@
|
||||
name: Deploy to GitHub Pages
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- "published"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
concurrency:
|
||||
group: "pages"
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
- name: Setup Pages
|
||||
uses: actions/configure-pages@v5
|
||||
- name: Fix anchor tag in README
|
||||
run: ex -s -c '%s/docs\/getting-started\.md/docs\/getting-started/|x' README.md
|
||||
- name: Build with Jekyll
|
||||
uses: actions/jekyll-build-pages@v1
|
||||
with:
|
||||
source: ./
|
||||
destination: ./_site
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
deploy:
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
steps:
|
||||
- name: Deploy to GitHub Pages
|
||||
id: deployment
|
||||
uses: actions/deploy-pages@v4
|
@ -1,62 +0,0 @@
|
||||
# Contributing to `zk`
|
||||
|
||||
## Understanding the codebase
|
||||
|
||||
### Building the project
|
||||
|
||||
It is recommended to use the `Makefile` for compiling the project, as the `go` command requires a few parameters.
|
||||
|
||||
```shell
|
||||
make build
|
||||
```
|
||||
|
||||
This will be expanded to the following command:
|
||||
|
||||
```shell
|
||||
CGO_ENABLED=1 GOARCH=arm64 go build -tags "fts5" -ldflags "-X=main.Version=`git describe --tags --match v[0-9]* 2> /dev/null` -X=main.Build=`git rev-parse --short HEAD`"
|
||||
```
|
||||
|
||||
- `CGO_ENABLED=1` enables CGO, which is required by the `mattn/go-sqlite3` dependency.
|
||||
- `GOARCH=arm64` is only required for Apple Silicon chips.
|
||||
- `-tags "fts5"` enables the FTS option with `mattn/go-sqlite3`, which handles much of the magic behind `zk`'s `--match` filtering option.
|
||||
- ``-ldflags "-X=main.Version=`git describe --tags --match v[0-9]* 2> /dev/null` -X=main.Build=`git rev-parse --short HEAD`"`` will automatically set `zk`'s build and version numbers using the latest Git tag and commit SHA.
|
||||
|
||||
### Automated tests
|
||||
|
||||
The project is vetted with two different kind of automated tests: unit tests and end-to-end tests.
|
||||
|
||||
#### Unit tests
|
||||
|
||||
Unit tests are using the standard [Go testing library](https://pkg.go.dev/testing). To execute them, use the command `make test`.
|
||||
|
||||
They are ideal for testing parsing output or individual API edge cases and minutiae.
|
||||
|
||||
#### End-to-end tests
|
||||
|
||||
Most of `zk`'s functionality is tested with functional tests ran with [`tesh`](https://github.com/mickael-menu/tesh), which you can execute with `make tesh` (or `make teshb`, to debug whitespaces changes).
|
||||
|
||||
When addressing a GitHub issue, it's a good idea to begin by creating a `tesh` file in `tests/issue-XXX.tesh`. If a starting notebook state is required, it can be added under `tests/fixtures`.
|
||||
|
||||
If you modify the output of `zk`, you may disrupt some `tesh` files. You can use `make tesh-update` to automatically update them with the correct output.
|
||||
|
||||
### CI workflows
|
||||
|
||||
Several GitHub action workflows are executed when pull requests are merged or releases are created.
|
||||
|
||||
- `.github/workflows/build.yml` checks that the project can be built and the tests still pass.
|
||||
- `.github/workflows/codeql.yml` runs static analysis to vet code quality.
|
||||
- `.github/workflows/gh-pages.yml` deploy the documentation files to GitHub Pages.
|
||||
- `.github/workflows/release.yml` submits a new version to Homebrew when a Git version tag is created.
|
||||
- `.github/workflows/triage.yml` automatically tags old issues and PRs as staled.
|
||||
|
||||
## Releasing a new version
|
||||
|
||||
When `zk` is ready to be released, you can update the `CHANGELOG.md` ([for example](https://github.com/zk-org/zk/commit/ea4457ad671aa85a6b15747460c6f2c9ad61bf73)) and create a new Git version tag (for example `v0.13.0`). Make sure you follow the [Semantic Versioning](https://semver.org) scheme.
|
||||
|
||||
Then, create [a new GitHub release](https://github.com/zk-org/zk/releases) with a copy of the latest `CHANGELOG.md` entries and the binaries for all supported platforms.
|
||||
|
||||
Binaries can be created automatically using `make dist-linux` and `make dist-macos`.
|
||||
|
||||
Unfortunately, `make dist-macos` must be run manually on both an Apple Silicon and Intel chips. The Linux builds are created using Docker and [these custom images](https://github.com/zk-org/zk-xcompile), which are hosted via [ghcr.io within zk-org](https://github.com/orgs/zk-org/packages/container/package/zk-xcompile).
|
||||
|
||||
This process is convoluted because `zk` requires CGO with `mattn/go-sqlite3`, which prevents using Go's native cross-compilation. Transitioning to a CGO-free SQLite driver such as [cznic/sqlite](https://gitlab.com/cznic/sqlite) could simplify the distribution process significantly.
|
@ -1,24 +0,0 @@
|
||||
title: "zk"
|
||||
permalink: /:title
|
||||
defaults:
|
||||
- scope:
|
||||
path: "README.md"
|
||||
values:
|
||||
title: "zk"
|
||||
- scope:
|
||||
path: "" # all
|
||||
values:
|
||||
render_with_liquid: false
|
||||
exclude:
|
||||
- ".github/"
|
||||
- ".gitignore"
|
||||
- "CHANGELOG.md"
|
||||
- "CONTRIBUTING.md"
|
||||
- "LICENSE"
|
||||
- "Makefile"
|
||||
- "go.mod"
|
||||
- "go.sum"
|
||||
- "internal/"
|
||||
- "main.go"
|
||||
- "tests/"
|
||||
|
@ -0,0 +1,2 @@
|
||||
permalink: /:title
|
||||
theme: jekyll-theme-modernist
|
@ -0,0 +1,57 @@
|
||||
<!doctype html>
|
||||
<html lang="{{ site.lang | default: "en-US" }}">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
|
||||
{% seo %}
|
||||
|
||||
<link rel="stylesheet" href="{{ '/assets/css/style.css?v=' | append: site.github.build_revision | relative_url }}">
|
||||
<script src="{{ '/assets/js/scale.fix.js' | relative_url }}"></script>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
|
||||
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div class="wrapper">
|
||||
<header {% unless site.description or site.github.project_tagline %} class="without-description" {% endunless %}>
|
||||
<h1><a href="https://mickael-menu.github.io/zk/">{{ site.title | default: site.github.repository_name }}</a></h1>
|
||||
{% if site.description or site.github.project_tagline %}
|
||||
<p>{{ site.description | default: site.github.project_tagline }}</p>
|
||||
{% endif %}
|
||||
<p class="view"><a href="{{ site.github.repository_url }}">View the Project on GitHub <small>{{ github_name }}</small></a></p>
|
||||
<ul>
|
||||
{% if site.show_downloads %}
|
||||
<li><a href="{{ site.github.zip_url }}">Download <strong>ZIP File</strong></a></li>
|
||||
<li><a href="{{ site.github.tar_url }}">Download <strong>TAR Ball</strong></a></li>
|
||||
{% endif %}
|
||||
<li><a href="{{ site.github.repository_url }}">View On <strong>GitHub</strong></a></li>
|
||||
</ul>
|
||||
</header>
|
||||
<section>
|
||||
|
||||
{{ content }}
|
||||
|
||||
</section>
|
||||
</div>
|
||||
<footer>
|
||||
{% if site.github.is_project_page %}
|
||||
<p>Project maintained by <a href="{{ site.github.owner_url }}">{{ site.github.owner_name }}</a></p>
|
||||
{% endif %}
|
||||
</footer>
|
||||
<!--[if !IE]><script>fixScale(document);</script><![endif]-->
|
||||
|
||||
{% if site.google_analytics %}
|
||||
<script>
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||||
ga('create', '{{ site.google_analytics }}', 'auto');
|
||||
ga('send', 'pageview');
|
||||
</script>
|
||||
{% endif %}
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,9 @@
|
||||
---
|
||||
---
|
||||
|
||||
@import "{{ site.theme }}";
|
||||
|
||||
code, pre {
|
||||
font-size: inherit;
|
||||
}
|
||||
|
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 29 KiB After Width: | Height: | Size: 29 KiB |
Binary file not shown.
Before Width: | Height: | Size: 3.9 KiB |
@ -1,15 +1,15 @@
|
||||
package fixtures
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
// Path returns the absolute path to the given fixture.
|
||||
func Path(name string) string {
|
||||
cwd, err := os.Getwd()
|
||||
if err != nil {
|
||||
panic("failed to obtain current working directory")
|
||||
_, callerPath, _, ok := runtime.Caller(1)
|
||||
if !ok {
|
||||
panic("failed to get the caller's path")
|
||||
}
|
||||
return filepath.Join(cwd, "testdata", name)
|
||||
return filepath.Join(filepath.Dir(callerPath), "testdata", name)
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue