Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
myypo committed Jun 24, 2024
0 parents commit 8016354
Show file tree
Hide file tree
Showing 75 changed files with 6,825 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[target.x86_64-apple-darwin]
rustflags = [
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
]

[target.aarch64-apple-darwin]
rustflags = [
"-C", "link-arg=-undefined",
"-C", "link-arg=dynamic_lookup",
]
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
46 changes: 46 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Bug Report
description: Open a bug related issue
title: "bug: "
labels: [bug]
body:
- type: markdown
attributes:
value: |
Before reporting an issue, please, make sure to read the [documentation](https://github.com/myypo/compass.nvim) and read through all of the [open and closed issues](https://github.com/myypo/compass.nvim/issues) as well as any existing [discussions](https://github.com/myypo/compass.nvim/discussions)
- type: checkboxes
attributes:
label: Did you check docs and existing issues?
description: Make sure you checked all of the below before submitting an issue
options:
- label: I have read the plugin's documentation
required: true
- label: I have searched through existing issues of the plugin, as well as discussions
required: true
- type: textarea
attributes:
label: Your platform and neovim version
description: The OS where the bug was encountered and the output of `nvim --version`
validations:
required: true
- type: textarea
attributes:
label: Describe the bug
description: A clear and concise description of what the bug is. Please include any related errors you see in Neovim.
validations:
required: true
- type: textarea
attributes:
label: Steps To Reproduce
description: Steps to reproduce the behavior.
placeholder: |
1.
2.
3.
validations:
required: true
- type: textarea
attributes:
label: Expected Behavior
description: A concise description of what you expected to happen.
validations:
required: true
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Feature Request
description: Suggest a new feature
title: "feature: "
labels: [enhancement]
body:
- type: checkboxes
attributes:
label: Did you check the docs?
options:
- label: I have read all of the plugin's docs
required: true
- type: checkboxes
attributes:
label: Are there no similiar feature requests?
options:
- label: There are no existing requests for this feature
required: true
- type: textarea
validations:
required: true
attributes:
label: Describe the feature and solution you'd like
description: A clear and concise description of what you want to happen.
- type: textarea
validations:
required: false
attributes:
label: Additional context
description: Add any other context or screenshots about the feature request here.
146 changes: 146 additions & 0 deletions .github/workflows/ci-cd.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
name: CI/CD

on:
push:
branches:
- main
paths-ignore:
- README.md
pull_request:
branches:
- main
paths-ignore:
- README.md
schedule:
- cron: "0 12 * * *"
workflow_dispatch:
inputs:
tag_name:
description: "Tag name for release"
required: false
default: nightly

jobs:
test:
timeout-minutes: 5
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
neovim: [stable, nightly]

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
- name: Install Neovim ${{ matrix.neovim }}
uses: rhysd/action-setup-vim@v1
with:
neovim: true
version: ${{ matrix.neovim }}
- name: Install latest nightly rustc
uses: dtolnay/rust-toolchain@nightly
- name: Run unit tests
run: |
cargo build
cargo test
clippy:
name: clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: clippy
- run: cargo clippy -- -D warnings

format:
name: format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- run: cargo fmt --check

build:
needs: [test, clippy, format]
name: build for ${{ matrix.platform.os_name }}
runs-on: ${{ matrix.platform.os }}
permissions:
contents: write
strategy:
fail-fast: false
matrix:
platform:
- os_name: linux-x86_64
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
lib_name: libcompass
lib_extension: so

- os_name: mac-x86_64
os: macos-latest
target: x86_64-apple-darwin
lib_name: libcompass
lib_extension: dylib

- os_name: mac-aarch64
os: macos-latest
target: aarch64-apple-darwin
lib_name: libcompass
lib_extension: dylib

- os_name: windows-x86_64
os: windows-latest
target: x86_64-pc-windows-msvc
lib_name: compass
lib_extension: dll
steps:
- uses: actions/checkout@v4
- name: Build libraries
uses: houseabsolute/actions-rust-cross@v0
with:
command: "build"
target: ${{ matrix.platform.target }}
toolchain: nightly
args: "--locked --release"
strip: true
- name: Upload libraries
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.platform.os_name }}
path: target/${{ matrix.platform.target }}/release/${{ matrix.platform.lib_name }}.${{ matrix.platform.lib_extension }}
publish:
needs: build
runs-on: ubuntu-latest
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4

- uses: actions/download-artifact@v4

- run: |
mv linux-x86_64/libcompass.so linux-x86_64.so
mv mac-aarch64/libcompass.dylib mac-aarch64.dylib
mv mac-x86_64/libcompass.dylib mac-x86_64.dylib
mv windows-x86_64/compass.dll windows-x86_64.dll
gh release delete nightly --yes || true
- name: release
uses: softprops/action-gh-release@v2
with:
prerelease: true
make_latest: true
tag_name: nightly
files: |
linux-x86_64.so
mac-aarch64.dylib
mac-x86_64.dylib
windows-x86_64.dll
30 changes: 30 additions & 0 deletions .github/workflows/vimdoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Generate vimdoc

on:
push:
branches:
- main
paths:
- README.md

jobs:
docs:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Generate panvimdoc
uses: kdheepak/panvimdoc@main
with:
vimdoc: compass.nvim
version: "Neovim >= 0.8.0"
demojify: true
treesitter: true
- name: Commit generated doc
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "chore(build): auto-generate vimdoc"
commit_user_name: "github-actions[bot]"
commit_user_email: "github-actions[bot]@users.noreply.github.com"
commit_author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
target
result

lua/*
!lua/.gitkeep
Loading

0 comments on commit 8016354

Please sign in to comment.