Skip to content

Commit

Permalink
Migrate tests to GitHub actions (#5)
Browse files Browse the repository at this point in the history
* Rename flavor file
* Update dependencies
* TST: Update vimrunner config
* Git-Ignore logs and locks
* CI: Register vim actions for testing
* Provide issue templates
* TST: Fix style name in tests
* DOC: Fix doc generation
  • Loading branch information
LucHermitte authored Aug 25, 2024
1 parent ab67665 commit b157e90
Show file tree
Hide file tree
Showing 18 changed files with 246 additions and 57 deletions.
29 changes: 29 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: Bug report
about: Create a report to help us improve
labels: bug

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If pertinent, add screenshots to help explain your problem.

** Context (please complete the following information):**
- Vim version [e.g. 8.0.1157]
- Other plugins installed

**Additional context**
Add any other context about the problem here.
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
name: Feature request
about: Suggest an idea for this project

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] ; I'd like to be able to [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
59 changes: 59 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby

name: CI

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

permissions:
contents: read

jobs:
test:
name: "test on ${{ matrix.os }} ; ${{ matrix.neovim && 'neovim' || 'vim' }}"

strategy:
matrix:
# Testing doesn't seem to work on Windows: output log file
# cannot be read...
# os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, macos-latest]
neovim: [false]
# neovim: [false, true]
# TODO: Test different flavours of Vim...

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

steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Setup Vim
uses: rhysd/action-setup-vim@v1
# uses: thinca/action-setup-vim@v2
id: vim
with:
neovim: ${{matrix.neovim }}
configure-args: |
--with-features=huge
- name: Run tests on Linux
if: runner.os == 'Linux' # headless execution is required on Linux
run: |
bundle list
xvfb-run bundle exec rake ci
- name: Run tests on ${{ matrix.os }}
if: runner.os != 'Linux'
run: |
bundle exec rake ci
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ tags
*.sw*
*~
*.pyc
tests/lh/*.log
*.lock
35 changes: 35 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.12"
# You can also specify other tool versions:
# nodejs: "20"
# rust: "1.70"
# golang: "1.20"

# Build documentation in the "doc/" directory with Sphinx
sphinx:
configuration: doc/conf.py
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
# builder: "dirhtml"
# Fail on all warnings to avoid broken references
# fail_on_warning: true

# Optionally build your docs in additional formats such as PDF and ePub
# formats:
# - pdf
# - epub

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
python:
install:
- requirements: doc/requirements.txt
File renamed without changes.
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source 'https://rubygems.org'

gem 'rspec', '~> 3.9.0'
gem 'vimrunner', '~> 0.3.4'
gem 'rspec', '~> 3.13.0'
gem 'vimrunner', '~> 0.3.5'
gem 'rake', '~> 13.0.1'
gem 'vim-flavor', '~> 2.2.2'
gem 'vim-flavor', '~> 4.0.3'
57 changes: 36 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# lh-style [![Last release](https://img.shields.io/github/tag/LucHermitte/lh-style.svg)](https://github.com/LucHermitte/lh-style/releases) [![Build Status](https://secure.travis-ci.org/LucHermitte/lh-style.png?branch=master)](http://travis-ci.org/LucHermitte/lh-style) [![Documentation Status](https://readthedocs.org/projects/lh-style/badge/?version=latest)](http://lh-style.readthedocs.io/en/latest/?badge=latest) [![Project Stats](https://www.openhub.net/p/21020/widgets/project_thin_badge.gif)](https://www.openhub.net/p/21020)
# lh-style [![Last release][Releases-badge]][Releases-url] [![Build Status][gh-action-badge]][gh-action-result] [![Documentation Status][rtd-badge]][rtd-url] [![Project Stats][openhub-badge]][openhub-url]

[Releases-badge]: https://img.shields.io/github/tag/LucHermitte/lh-style.svg
[Releases-url]: https://github.com/LucHermitte/lh-style/tags
[gh-action-badge]: ./../../actions/workflows/tests.yml/badge.svg?branch=master "Test"
[gh-action-result]: ./../../actions/workflows/tests.yml?query=branch%3Amaster
[openhub-badge]: https://www.openhub.net/p/21020/widgets/project_thin_badge.gif
[openhub-url]: https://www.openhub.net/p/21020
[rtd-badge]: https://readthedocs.org/projects/lh-style/badge/?version=latest
[rtd-url]: http://lh-style.readthedocs.io/en/latest/?badge=latest

Discl. This page is currently under heavy reorganization!

Expand Down Expand Up @@ -69,27 +77,34 @@ Contributions are welcomed. I've yet to write a proper CONTRIBUTING.md guide reg
* [editorconfig-vim](https://github.com/editorconfig/editorconfig-vim) (optional).
* Install with [vim-addon-manager](https://github.com/MarcWeber/vim-addon-manager) any plugin that requires lh-style should be enough.
* With [vim-addon-manager](https://github.com/MarcWeber/vim-addon-manager), install lh-style (this is the preferred method because of the [dependencies](http://github.com/LucHermitte/lh-style/blob/master/addon-info.txt)).
```vim
ActivateAddons lh-style
" will also install editorconfig-vim
```

```vim
ActivateAddons lh-style
" will also install editorconfig-vim
```
* [vim-flavor](http://github.com/kana/vim-flavor) (which also supports
dependencies)
```
flavor 'LucHermitte/lh-style'
" will also install editorconfig-vim
```
```
flavor 'LucHermitte/lh-style'
" will also install editorconfig-vim
```
* Vundle/NeoBundle:
```vim
Bundle 'LucHermitte/lh-vim-lib'
Bundle 'LucHermitte/lh-style'
" Optional
Bundle 'editorconfig/editorconfig-vim'
```
```vim
Bundle 'LucHermitte/lh-vim-lib'
Bundle 'LucHermitte/lh-style'
" Optional
Bundle 'editorconfig/editorconfig-vim'
```
* Clone from the git repositories
```
git clone git@github.com:LucHermitte/lh-vim-lib.git
git clone git@github.com:LucHermitte/lh-style.git
" Optional
git clone git@github.com:editorconfig/editorconfig-vim'
```
```bash
git clone git@github.com:LucHermitte/lh-vim-lib.git
git clone git@github.com:LucHermitte/lh-style.git
" Optional
git clone git@github.com:editorconfig/editorconfig-vim'
```
7 changes: 4 additions & 3 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ end
task :test => :spec

task :spec do
sh "rspec ~/.vim-flavor/repos/LucHermitte_vim-UT/spec"
# 'spec' is implicitly run as well
# sh 'rspec --require spec_helper'
sh "bundle exec rspec ~/.vim-flavor/repos/LucHermitte_vim-UT/spec/UT_spec_v2.rb"
end

task :install do
sh 'cat VimFlavor >> tests/VimFlavor'
sh 'cat Flavorfile >> tests/Flavorfile'
sh 'cd tests && bundle exec vim-flavor install'
end

25 changes: 12 additions & 13 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,23 +32,19 @@
extensions = [
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.githubpages'
'sphinx.ext.githubpages',
"sphinx_rtd_theme",
'm2r2',
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

from recommonmark.parser import CommonMarkParser

source_parsers = {
'.md': CommonMarkParser,
}

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = ['.rst', '.md']
source_suffix = ['.rst']

# The encoding of source files.
#
Expand All @@ -59,7 +55,7 @@

# General information about the project.
project = u'lh-style'
copyright = u'2011-2017, Luc Hermitte'
copyright = u'2011-2024, Luc Hermitte'
author = u'Luc Hermitte'

# The version info for the project you're documenting, acts as replacement for
Expand All @@ -76,7 +72,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = 'en'

# There are two options for replacing |today|: either, you set today to some
# non-false value, then it is used:
Expand Down Expand Up @@ -129,7 +125,8 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'default'
# html_theme = 'default'
html_theme = 'sphinx_rtd_theme'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down Expand Up @@ -163,7 +160,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# html_static_path = ['_static']

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
Expand Down Expand Up @@ -349,4 +346,6 @@


# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/3/': None}
intersphinx_mapping = {
"Python": ("https://docs.python.org/3/", None),
}
4 changes: 2 additions & 2 deletions doc/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
Bundle 'editorconfig/editorconfig-vim'
```
* Clone from the git repositories, and update your [`'runtimepath'`](http://vimhelp.appspot.com/options.txt.html#%27runtimepath%27)
* Clone from the git repositories, and update your ['runtimepath'](http://vimhelp.appspot.com/options.txt.html#%27runtimepath%27)
```bash
git clone git@github.com:LucHermitte/lh-vim-lib.git
git clone git@github.com:LucHermitte/lh-style.git
# Optional
git clone git@github.com:editorconfig/editorconfig-vim'
git clone git@github.com:editorconfig/editorconfig-vim
```
3 changes: 3 additions & 0 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sphinx
sphinx_rtd_theme==2.0.0
m2r2
2 changes: 1 addition & 1 deletion mkVba/mk-lh-style.vim
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ addon-info.txt
plugin/style.vim
tests/lh/naming.vim
tests/lh/style.vim
VimFlavor
Flavorfile
Loading

0 comments on commit b157e90

Please sign in to comment.