-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
98 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Container | ||
on: | ||
push: | ||
branches: ['main'] | ||
|
||
jobs: | ||
build-and-push-image: | ||
env: | ||
IMAGE_NAME: ${{ github.repository }} | ||
REGISTRY: ghcr.io | ||
permissions: | ||
contents: read | ||
packages: write | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
neovim: [stable, nightly] | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}-neovim-${{ matrix.neovim }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
on: [push, pull_request] | ||
name: Stylua | ||
|
||
jobs: | ||
|
||
stylua: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
nvim-versions: ["stable", "nightly"] | ||
name: Stylua | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: JohnnyMorganz/stylua-action@v2 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
version: latest | ||
args: --check . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
FROM debian:bullseye-slim AS neovim | ||
ARG NVIM_VERSION | ||
ENV NVIM_VERSION=${NVIM_VERSION:-stable} | ||
ENV BUILD_REQUIREMENTS "cmake curl gcc gettext git ninja-build unzip" | ||
RUN apt-get update && \ | ||
apt-get install -y ${BUILD_REQUIREMENTS} && \ | ||
git clone --branch ${NVIM_VERSION} https://github.com/neovim/neovim && \ | ||
cd neovim && \ | ||
make install && \ | ||
rm -rf ../neovim && \ | ||
apt-get remove -y ${BUILD_REQUIREMENTS} && \ | ||
apt-get autoremove -y && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
FROM rust:slim-bullseye AS tree-sitter-cli | ||
RUN cargo install tree-sitter-cli | ||
|
||
FROM debian:bullseye-slim | ||
COPY --from=neovim /usr/local/share/nvim /usr/local/share/nvim | ||
COPY --from=neovim /usr/local/lib/nvim /usr/local/lib/nvim | ||
COPY --from=neovim /usr/local/bin/nvim /usr/local/bin/nvim | ||
COPY --from=tree-sitter-cli /usr/local/cargo/bin/tree-sitter /usr/local/bin/tree-sitter | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y curl g++ git && \ | ||
apt-get autoremove -y && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
useradd -ms /bin/bash yaml | ||
|
||
USER yaml | ||
WORKDIR /home/yaml/ | ||
RUN mkdir -p .config/nvim/ | ||
ADD tests/init.lua .config/nvim/init.lua | ||
ADD . . | ||
|
||
CMD ["nvim", "--headless", "-c", "PlenaryBustedDirectory tests/yaml_nvim { minimal_init = 'tests/init.lua' }"] |