Skip to content

Commit

Permalink
Add ccls language server
Browse files Browse the repository at this point in the history
From https://github.com/MaskRay/ccls

(cherry picked from commit 601937c)

Add build action to publish from my account until it's been merged upstream.
  • Loading branch information
bkhl committed Jul 6, 2024
1 parent 6a335da commit 45c1c68
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 107 deletions.
120 changes: 13 additions & 107 deletions .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
name: Push LSP Docker Images
---
name: Build and push LSP Docker Images

on:
pull_request:
push:
branches: [main]
branches:
- main
schedule:
- cron: '0 3 * * *'
- cron: '0 3 0 * *'

jobs:
build_and_push:
Expand All @@ -15,112 +17,16 @@ jobs:
fail-fast: false
matrix:
include:
- context: bashls
tag: bash-language-server

- context: clangd
tag: clangd-language-server

- context: denols
tag: denols

- context: dockerls
tag: docker-language-server

- context: eslintls
tag: eslint-language-server

- context: gopls
tag: gopls

- context: graphql-lsp
tag: graphql-language-service-cli

- context: html
tag: html-language-server

- context: intelephense
tag: intelephense

- context: jsonls
tag: json-language-server

- context: lemminx
tag: lemminx

- context: omnisharp
tag: omnisharp

- context: powershell_es
tag: powershell-language-server

- context: prisma
tag: prisma-language-server

- context: pylsp
tag: python-lsp-server

- context: pyright
tag: pyright-langserver

- context: rust_analyzer
tag: rust-analyzer

- context: solargraph
tag: solargraph

- context: sumneko_lua
tag: lua-language-server

- context: svelteserver
tag: svelte-language-server

- context: tailwindcss
tag: tailwindcss-language-server

- context: terraformls
tag: terraform-ls

- context: tsserver
tag: typescript-language-server

- context: volar
tag: volar

- context: vuels
tag: vue-language-server

- context: yamlls
tag: yaml-language-server

- context: ccls
tag: ccls
steps:
- name: Check out the repo
uses: actions/checkout@v4

# TODO: Replace w/ Github Action - https://github.com/lspcontainers/dockerfiles/runs/2724936969?check_suite_focus=true#step:4:7
- name: Run hadolint
run: >
docker container run
--entrypoint hadolint
--rm
--volume $(pwd):/code
--workdir /code
hadolint/hadolint:latest-alpine
servers/${{ matrix.context }}/Dockerfile
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
if: ${{ github.ref == 'refs/heads/main' }}

- name: Build and push to Docker Hub
uses: docker/build-push-action@v5
- name: Build and push image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: servers/${{ matrix.context }}
push: ${{ github.ref == 'refs/heads/main' }}
tags: lspcontainers/${{ matrix.tag }}:latest
context: servers/${{matrix.context}}
file: ./Dockerfile
push: true
outputs: type=image,name=${{matrix.tag}},annotation-index.org.opencontainers.image.description=ccls
5 changes: 5 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ services:
build:
context: servers/bashls

ccls:
image: lspcontainers/ccls
build:
context: servers/clangd

clangd:
image: lspcontainers/clangd-language-server
build:
Expand Down
20 changes: 20 additions & 0 deletions servers/ccls/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
FROM alpine as builder

RUN apk add --no-cache clang17-dev clang17-static llvm17-dev llvm17-static llvm17-gtest cmake make git
RUN git clone --depth=1 --recursive https://github.com/MaskRay/ccls /ccls

WORKDIR /ccls

RUN cmake -H. -BRelease -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_COMPILER=/usr/bin/clang++-17 \
-DCMAKE_PREFIX_PATH=/usr/lib/llvm17
RUN cmake --build Release
RUN cmake --build Release --target install

FROM alpine

RUN apk add --no-cache clang17

COPY --from=builder /usr/local/bin/ccls /usr/local/bin/ccls

CMD ["/usr/local/bin/ccls"]

0 comments on commit 45c1c68

Please sign in to comment.