Skip to content

Commit abc070e

Browse files
committed
add gh actions, parquet police & release cliff
1 parent b131b6f commit abc070e

File tree

4 files changed

+184
-5
lines changed

4 files changed

+184
-5
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Parquet Police
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
12+
jobs:
13+
check:
14+
name: Lint
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- uses: dtolnay/rust-toolchain@stable
20+
with:
21+
components: rustfmt, clippy
22+
23+
- uses: Swatinem/rust-cache@v2
24+
25+
- name: Check formatting
26+
run: cargo fmt -- --check
27+
28+
- name: Clippy
29+
run: cargo clippy --all-targets --all-features -- -D warnings
30+
31+
test:
32+
name: Test (${{ matrix.os }})
33+
needs: check
34+
strategy:
35+
matrix:
36+
os: [ubuntu-latest, macos-latest, windows-latest]
37+
runs-on: ${{ matrix.os }}
38+
steps:
39+
- uses: actions/checkout@v4
40+
41+
- uses: dtolnay/rust-toolchain@stable
42+
43+
- uses: Swatinem/rust-cache@v2
44+
45+
- name: Run tests
46+
run: cargo test --all

.github/workflows/release.yml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v[0-9]+.[0-9]+.[0-9]+*"
7+
8+
permissions:
9+
contents: write
10+
11+
env:
12+
CARGO_TERM_COLOR: always
13+
14+
jobs:
15+
build:
16+
name: Build (${{ matrix.target }})
17+
strategy:
18+
matrix:
19+
include:
20+
- target: x86_64-unknown-linux-gnu
21+
os: ubuntu-latest
22+
- target: aarch64-unknown-linux-gnu
23+
os: ubuntu-latest
24+
cross: true
25+
- target: x86_64-apple-darwin
26+
os: macos-latest
27+
- target: aarch64-apple-darwin
28+
os: macos-latest
29+
- target: x86_64-pc-windows-msvc
30+
os: windows-latest
31+
runs-on: ${{ matrix.os }}
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- uses: dtolnay/rust-toolchain@stable
36+
with:
37+
targets: ${{ matrix.target }}
38+
39+
- uses: Swatinem/rust-cache@v2
40+
with:
41+
key: ${{ matrix.target }}
42+
43+
- name: Install cross
44+
if: matrix.cross
45+
run: cargo install cross --locked
46+
47+
- name: Build
48+
run: |
49+
if [ "${{ matrix.cross }}" = "true" ]; then
50+
cross build --release --target ${{ matrix.target }}
51+
else
52+
cargo build --release --target ${{ matrix.target }}
53+
fi
54+
shell: bash
55+
56+
- name: Package (unix)
57+
if: runner.os != 'Windows'
58+
run: |
59+
cd target/${{ matrix.target }}/release
60+
tar czf ../../../pq-${{ github.ref_name }}-${{ matrix.target }}.tar.gz pq
61+
cd ../../..
62+
shasum -a 256 pq-${{ github.ref_name }}-${{ matrix.target }}.tar.gz > pq-${{ github.ref_name }}-${{ matrix.target }}.tar.gz.sha256
63+
64+
- name: Package (windows)
65+
if: runner.os == 'Windows'
66+
shell: pwsh
67+
run: |
68+
Compress-Archive -Path "target/${{ matrix.target }}/release/pq.exe" -DestinationPath "pq-${{ github.ref_name }}-${{ matrix.target }}.zip"
69+
(Get-FileHash "pq-${{ github.ref_name }}-${{ matrix.target }}.zip" -Algorithm SHA256).Hash.ToLower() + " pq-${{ github.ref_name }}-${{ matrix.target }}.zip" | Out-File "pq-${{ github.ref_name }}-${{ matrix.target }}.zip.sha256" -Encoding ascii
70+
71+
- name: Upload artifacts
72+
uses: actions/upload-artifact@v4
73+
with:
74+
name: pq-${{ matrix.target }}
75+
path: |
76+
pq-*.tar.gz
77+
pq-*.tar.gz.sha256
78+
pq-*.zip
79+
pq-*.zip.sha256
80+
81+
release:
82+
name: Release
83+
needs: build
84+
runs-on: ubuntu-latest
85+
steps:
86+
- uses: actions/checkout@v4
87+
with:
88+
fetch-depth: 0
89+
90+
- name: Download artifacts
91+
uses: actions/download-artifact@v4
92+
with:
93+
path: artifacts
94+
merge-multiple: true
95+
96+
- name: Generate changelog
97+
id: changelog
98+
run: |
99+
pip install --user git-cliff || pipx install git-cliff || cargo install git-cliff
100+
git cliff --latest --strip header > RELEASE_NOTES.md
101+
cat RELEASE_NOTES.md
102+
103+
- name: Create GitHub Release
104+
uses: softprops/action-gh-release@v2
105+
with:
106+
body_path: RELEASE_NOTES.md
107+
files: |
108+
artifacts/*
109+
generate_release_notes: false

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
# pq
1+
# pq - the Swiss Knife of Parquet
22

3-
[![CI](https://github.com/OrlovEvgeny/pq/workflows/CI/badge.svg)](https://github.com/OrlovEvgeny/pq/actions)
3+
[![Parquet Police](https://github.com/OrlovEvgeny/pq/workflows/Parquet%20Police/badge.svg)](https://github.com/OrlovEvgeny/pq/actions)
4+
[![Release](https://img.shields.io/github/v/release/OrlovEvgeny/pq)](https://github.com/OrlovEvgeny/pq/releases/latest)
45

5-
A fast, feature-rich CLI for Parquet files. Inspect, transform, validate - without leaving the terminal.
6+
> Inspect, transform, and operate on Parquet files from your terminal. DDL generation for major databases, S3 / Cloudflare R2 / GCS / Azure Object Storage support, smart output formatting, and Unix composability
67
78
<p align="center">
89
<img src="doc/demo.gif" alt="pq demo" width="800">
910
</p>
1011

11-
A fast, feature-rich CLI for Parquet inspection, validation, and transformation. 16 commands with instant metadata reads from file footer, DDL generation for major databases, cloud storage support, smart output formatting, and Unix composability.
12-
1312
## Quick Start
1413

1514
```bash

cliff.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[changelog]
2+
header = ""
3+
body = """
4+
{% for group, commits in commits | group_by(attribute="group") %}
5+
### {{ group | upper_first }}
6+
{% for commit in commits %}
7+
- {{ commit.message | upper_first }} ({{ commit.id | truncate(length=7, end="") }})\
8+
{% endfor %}
9+
{% endfor %}
10+
"""
11+
trim = true
12+
13+
[git]
14+
conventional_commits = true
15+
filter_unconventional = false
16+
commit_parsers = [
17+
{ message = "^feat", group = "Features" },
18+
{ message = "^fix", group = "Bug Fixes" },
19+
{ message = "^perf", group = "Performance" },
20+
{ message = "^refactor", group = "Refactoring" },
21+
{ message = "^doc", group = "Documentation" },
22+
{ message = "^test", group = "Testing" },
23+
{ message = "^ci", group = "CI/CD" },
24+
{ message = "^chore", skip = true },
25+
]

0 commit comments

Comments
 (0)