-
Notifications
You must be signed in to change notification settings - Fork 1
Fix log level and error handling #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
dc90162
Fix log level and error handling
erichlf f02d874
Update docker file
erichlf 57cd577
Update action
erichlf c7fe5fe
Create matrix for NEOVIM version
erichlf 569195a
Switch to build-push-action
erichlf d94478e
comment out versions since build-args isn't supported yet
erichlf File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
@@ -1,22 +1,41 @@ | ||
on: [push, pull_request] | ||
on: [pull_request] | ||
name: default | ||
env: | ||
IMAGE_NAME: nvim-devcontainer-cli | ||
jobs: | ||
unit-tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
neovim-version: | ||
[ | ||
"v0.9.0", | ||
"v0.9.1", | ||
"v0.9.2", | ||
"v0.9.4", | ||
"v0.9.5", | ||
"v0.10.0", | ||
"v0.10.1", | ||
"v0.10.2", | ||
"v0.10.3", | ||
"stable", | ||
] | ||
fail-fast: false | ||
|
||
name: NEOVIM ${{ matrix.neovim-version }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Pre-build devcontainer image | ||
uses: actions/checkout@v4 | ||
- name: Pre-build devcontainer image for NEOVIM ${{ matrix.neovim-version }} | ||
uses: devcontainers/[email protected] | ||
with: | ||
imageName: ${{ env.IMAGE_NAME }} | ||
cacheFrom: ${{ env.IMAGE_NAME }} | ||
imageName: ${{ env.IMAGE_NAME }}-${{ matrix.neovim-version }} | ||
cacheFrom: ${{ env.IMAGE_NAME }}-${{ matrix.neovim-version }} | ||
push: never | ||
env: NEOVIM_VERSION=${{ matrix.neovim-version }} | ||
- name: Run tests inside the docker image | ||
uses: devcontainers/[email protected] | ||
with: | ||
cacheFrom: ${{ env.IMAGE_NAME }} | ||
cacheFrom: ${{ env.IMAGE_NAME }}-${{ matrix.neovim-version }} | ||
push: never | ||
runCmd: make test |
This file contains hidden or 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 |
---|---|---|
@@ -1,15 +1,15 @@ | ||
# Copyright (c) 2024 Erich L Foster | ||
# | ||
# | ||
# Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
# this software and associated documentation files (the "Software"), to deal in | ||
# the Software without restriction, including without limitation the rights to | ||
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies | ||
# of the Software, and to permit persons to whom the Software is furnished to do | ||
# so, subject to the following conditions: | ||
# | ||
# | ||
# The above copyright notice and this permission notice shall be included in all | ||
# copies or substantial portions of the Software. | ||
# | ||
# | ||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
|
@@ -18,8 +18,48 @@ | |
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
# SOFTWARE. | ||
|
||
ARG NEOVIM_VERSION="stable" | ||
FROM ubuntu:22.04 as builder | ||
|
||
ARG NEOVIM_VERSION | ||
|
||
# Install dependencies needed for building devcontainers/cli and developing in neovim | ||
RUN apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ | ||
apt-utils \ | ||
build-essential \ | ||
curl \ | ||
wget \ | ||
nodejs \ | ||
npm \ | ||
lua5.1 \ | ||
luajit \ | ||
luarocks \ | ||
git \ | ||
# apt clean-up | ||
&& apt-get autoremove -y \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /tmp | ||
|
||
# Install NEOVIM | ||
RUN \ | ||
if [ "$NEOVIM_VERSION" = "stable" ]; then \ | ||
curl -fLO https://github.com/neovim/neovim/releases/download/${NEOVIM_VERSION}/nvim-linux-x86_64.tar.gz; \ | ||
else \ | ||
curl -fLO https://github.com/neovim/neovim/releases/download/${NEOVIM_VERSION}/nvim-linux64.tar.gz; \ | ||
fi \ | ||
&& rm -rf /opt/nvim \ | ||
&& tar -C /opt -xzf nvim-*.tar.gz \ | ||
&& ln -s /opt/nvim-*/bin/nvim /usr/local/bin/nvim \ | ||
&& chmod u+x /usr/local/bin/nvim | ||
|
||
WORKDIR /app | ||
|
||
# Installing the devcontainers CLI and Lua Dependencies for testing LUA projects | ||
RUN npm install -g @devcontainers/[email protected] \ | ||
&& luarocks install busted | ||
|
||
ENV USER_NAME=my-app | ||
ARG GROUP_NAME=$USER_NAME | ||
ARG USER_ID=1000 | ||
|
@@ -31,37 +71,10 @@ RUN groupadd --gid $GROUP_ID $GROUP_NAME && \ | |
&& apt-get update \ | ||
&& apt-get install -y --no-install-recommends sudo \ | ||
&& echo $USER_NAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USER_NAME \ | ||
&& chmod 0440 /etc/sudoers.d/$USER_NAME | ||
&& chmod 0440 /etc/sudoers.d/$USER_NAME | ||
|
||
# Switch to user | ||
USER $USER_NAME | ||
|
||
# Install dependencies needed for building devcontainers/cli and developing in neovim | ||
RUN sudo apt-get update && \ | ||
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ | ||
apt-utils \ | ||
build-essential \ | ||
curl \ | ||
wget \ | ||
nodejs \ | ||
npm \ | ||
lua5.1 \ | ||
luajit \ | ||
luarocks \ | ||
git \ | ||
# apt clean-up | ||
&& sudo apt-get autoremove -y \ | ||
&& sudo rm -rf /var/lib/apt/lists/* | ||
|
||
ENV NPM_CONFIG_PREFIX=/home/$USER_NAME/.npm-global | ||
|
||
WORKDIR /app | ||
|
||
# Installing the devcontainers CLI | ||
RUN npm install -g @devcontainers/[email protected] | ||
|
||
# Installing Lua Dependencies for testing LUA projects | ||
RUN sudo luarocks install busted | ||
|
||
# this will prevent the .local directory from being owned by root on bind mount | ||
RUN mkdir -p /home/$USER_NAME/.local/share/nvim/lazy |
This file contains hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.