Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
(not for real, but this squashes all of my nasty pre-public-release work down because it embarrasses me)
  • Loading branch information
zkxs committed Aug 11, 2024
0 parents commit 9623141
Show file tree
Hide file tree
Showing 1,174 changed files with 12,110,347 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# https://EditorConfig.org
root = true

[*]
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
charset = utf-8

[*.rs]
indent_style = space
indent_size = 4

[*.yml]
indent_style = space
indent_size = 2

[*.md]
indent_style = space
indent_size = 2
trim_trailing_whitespace = false
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "cargo"
directory: "/"
schedule:
interval: "weekly"
target-branch: "prerelease"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
target-branch: "prerelease"
116 changes: 116 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# This file is part of cuniq. Copyright © 2024 cuniq contributors.
# cuniq is licensed under the GNU GPL v3.0 or any later version. See LICENSE file for full text.

name: Build
on:
push:
paths-ignore: # ignore files that can't alter build output
- '**.md'
- .github/dependabot.yml
- .github/workflows/ci.yml
- .github/workflows/publish.yml
- .gitignore
- docs/**
- LICENSE
- screenshots/**
jobs:
cargo-deny:
# only run for pushes to tags or non-dependabot branches
if: startsWith(github.ref, 'refs/tags/') || (startsWith(github.ref, 'refs/heads/') && !startsWith(github.ref, 'refs/heads/dependabot/'))
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v1
build:
# only run for pushes to tags or non-dependabot branches
if: startsWith(github.ref, 'refs/tags/') || (startsWith(github.ref, 'refs/heads/') && !startsWith(github.ref, 'refs/heads/dependabot/'))
strategy:
matrix:
target:
- runs-on: windows-latest
triple: x86_64-pc-windows-msvc
build-name: Windows
artifact-suffix: ''
suffix: .exe
path-separator: '\'
runner-can-execute: true
- runs-on: ubuntu-latest
triple: x86_64-unknown-linux-gnu
build-name: Linux
artifact-suffix: -linux
suffix: ''
path-separator: '/'
runner-can-execute: true
- runs-on: macos-latest
triple: x86_64-apple-darwin
build-name: macOS x86
artifact-suffix: -mac-x86
suffix: ''
path-separator: '/'
runner-can-execute: true
- runs-on: macos-latest
triple: aarch64-apple-darwin
build-name: macOS ARM
artifact-suffix: -mac-arm
suffix: ''
path-separator: '/'
runner-can-execute: false
fail-fast: false
name: Build ${{ matrix.target.build-name }}
runs-on: ${{ matrix.target.runs-on }}
steps:
- name: git checkout
uses: actions/checkout@v4
- name: Setup workflow cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Setup Rust stable toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: ${{ matrix.target.triple }}
- name: Setup Rust nightly toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: rust-src
target: ${{ matrix.target.triple }}
- name: Check
run: cargo +nightly clippy --all-features --all-targets --target ${{ matrix.target.triple }}
- name: Test (no features)
if: matrix.target.runner-can-execute
run: cargo +nightly test --no-default-features --target ${{ matrix.target.triple }}
- name: Test (all features)
if: matrix.target.runner-can-execute
run: cargo +nightly test --all-features --target ${{ matrix.target.triple }}
- name: Build
run: cargo +nightly build -Z build-std=std --release --target ${{ matrix.target.triple }}
- name: Upload workflow artifact
uses: actions/upload-artifact@v4
with:
name: cuniq-${{ matrix.target.triple }}
path: ./target/${{ matrix.target.triple }}/release/cuniq${{ matrix.target.suffix }}
if-no-files-found: error
- name: Rename artifact for release # action-gh-release is incapable of renaming files, so I have to do it manually
if: startsWith(github.ref, 'refs/tags/') # only run for pushes to tags
run: |
cp "./target/${{ matrix.target.triple }}/release/cuniq${{ matrix.target.suffix }}" "${{ runner.temp }}/cuniq${{ matrix.target.artifact-suffix }}${{ matrix.target.suffix }}"
ls "${{ runner.temp }}"
file "${{ runner.temp }}${{ matrix.target.path-separator }}cuniq${{ matrix.target.artifact-suffix }}${{ matrix.target.suffix }}"
shell: bash
- name: Upload release artifact
uses: softprops/action-gh-release@v0.1.14
if: startsWith(github.ref, 'refs/tags/') # only run for pushes to tags
with:
draft: true
files: ${{ runner.temp }}${{ matrix.target.path-separator }}cuniq${{ matrix.target.artifact-suffix }}${{ matrix.target.suffix }}
fail_on_unmatched_files: true
86 changes: 86 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# This file is part of cuniq. Copyright © 2024 cuniq contributors.
# cuniq is licensed under the GNU GPL v3.0 or any later version. See LICENSE file for full text.

name: CI
on:
pull_request:
branches: # run for pull requests that target master or prerelease
- master
- prerelease
paths-ignore: # ignore files that can't alter build output
- '**.md'
- .github/dependabot.yml
- .github/workflows/build.yml
- .github/workflows/publish.yml
- .gitignore
- docs/**
- LICENSE
- screenshots/**
jobs:
cargo-deny:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v1
test:
strategy:
matrix:
target:
- runs-on: windows-latest
triple: x86_64-pc-windows-msvc
build-name: Windows
artifact-suffix: ''
suffix: .exe
path-separator: '\'
runner-can-execute: true
- runs-on: ubuntu-latest
triple: x86_64-unknown-linux-gnu
build-name: Linux
artifact-suffix: -linux
suffix: ''
path-separator: '/'
runner-can-execute: true
- runs-on: macos-latest
triple: x86_64-apple-darwin
build-name: macOS x86
artifact-suffix: -mac-x86
suffix: ''
path-separator: '/'
runner-can-execute: true
- runs-on: macos-latest
triple: aarch64-apple-darwin
build-name: macOS ARM
artifact-suffix: -mac-arm
suffix: ''
path-separator: '/'
runner-can-execute: false
fail-fast: false
name: Test ${{ matrix.target.build-name }}
runs-on: ${{ matrix.target.runs-on }}
steps:
- name: git checkout
uses: actions/checkout@v4
- name: Setup workflow cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
target: ${{ matrix.target.triple }}
- name: Check
run: cargo +nightly clippy --all-features --all-targets --target ${{ matrix.target.triple }}
- name: Test (no features)
if: matrix.target.runner-can-execute
run: cargo +nightly test --no-default-features --target ${{ matrix.target.triple }}
- name: Test (all features)
if: matrix.target.runner-can-execute
run: cargo +nightly test --all-features --target ${{ matrix.target.triple }}
33 changes: 33 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# This file is part of cuniq. Copyright © 2024 cuniq contributors.
# cuniq is licensed under the GNU GPL v3.0 or any later version. See LICENSE file for full text.

name: Publish
on:
workflow_dispatch:
secrets:
CARGO_REGISTRY_TOKEN:
required: true
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: git checkout
uses: actions/checkout@v4
- name: Setup workflow cache
uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Setup Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Publish
run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Build output
/target

# Jetbrains IDE stuff
.idea/

# cargo flamegraph output
flamegraph.svg

# 100GB test file
/test_files/huge.txt
Loading

0 comments on commit 9623141

Please sign in to comment.