Skip to content
Snippets Groups Projects
Commit 07e9fd5b authored by nimrod's avatar nimrod
Browse files

Migrate to GitLab CI.

- Update pre-commit checks.
- Replace Travis CI with GitLab CI.
- Address new warnings from pre-commit checks.
parent e5eebaa4
Branches
No related tags found
No related merge requests found
Pipeline #274 passed
---
stages:
- test
pre-commit:
stage: test
image: adarnimrod/ci-images:pre-commit
variables:
XDG_CACHE_HOME: "$CI_PROJECT_DIR/.cache"
script:
- pre-commit run --all-files
cache:
paths:
- .cache/
bats:
stage: test
image: alpine
before_script:
- apk add --update bats git
- git config --global user.email "you@example.com"
- git config --global user.name "Your Name"
script:
- bats tests/
- repo: https://github.com/pre-commit/pre-commit-hooks ---
sha: v0.9.1 repos:
- repo: https://github.com/pre-commit/pre-commit-hooks.git
rev: v3.4.0
hooks: hooks:
- id: check-added-large-files - id: check-added-large-files
- id: check-merge-conflict - id: check-executables-have-shebangs
- id: check-yaml - id: check-merge-conflict
- repo: https://git.shore.co.il/nimrod/shell-pre-commit.git - id: check-symlinks
sha: v0.5.4 - id: check-yaml
- id: trailing-whitespace
- repo: https://git.shore.co.il/nimrod/shell-pre-commit.git
rev: v0.6.0
hooks: hooks:
- id: shell-lint - id: shell-lint
files: &shellscripts '^merge-conflict$' - id: shellcheck
- id: shellcheck
files: *shellscripts - repo: https://git.shore.co.il/nimrod/git-pre-commit.git
- repo: https://git.shore.co.il/nimrod/git-pre-commit.git rev: v0.1.1
sha: v0.1.1
hooks: hooks:
- id: merge-conflict - id: merge-conflict
- repo: https://github.com/pre-commit/pre-commit.git
rev: v2.9.3
hooks:
- id: validate_manifest
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.25.0
hooks:
- id: yamllint
- repo: https://github.com/amperser/proselint.git
rev: 0.10.2
hooks:
- id: proselint
types: [plain-text]
exclude: LICENSE
...@@ -5,4 +5,4 @@ ...@@ -5,4 +5,4 @@
language: script language: script
entry: merge-conflict entry: merge-conflict
files: '$^' files: '$^'
always_run: True always_run: true
---
dist: trusty
sudo: false
group: beta
cache:
- pip
- directories:
- $HOME/.pre-commit
- $HOME/.cabal
- $HOME/.ghc
matrix:
fast_finish: True
include:
- language: python
python: "3.6"
env:
PATH: "$HOME/.cabal/bin:$PATH"
addons:
apt:
packages:
- cabal-install
- ghc
install:
- cabal update && cabal install shellcheck
- pip install pre_commit | cat
- pre-commit install-hooks
script:
- pre-commit run --all-files
- language: shell
script:
bats -t tests/
notifications:
on_failure: never
email: false
# Git pre-commit hooks # Git pre-commit hooks
[![Build [![pipeline status](https://git.shore.co.il/nimrod/git-pre-commit/badges/master/pipeline.svg)](https://git.shore.co.il/nimrod/git-pre-commit/-/commits/master)
Status](https://travis-ci.org/adarnimrod/git-pre-commit.svg?branch=master)](https://travis-ci.org/adarnimrod/git-pre-commit)
[Pre-commit](http://pre-commit.com/) Git related hooks. [Pre-commit](http://pre-commit.com/) Git related hooks.
...@@ -28,4 +27,4 @@ This software is licensed under the MIT license (see the `LICENSE.txt` file). ...@@ -28,4 +27,4 @@ This software is licensed under the MIT license (see the `LICENSE.txt` file).
Nimrod Adar, [contact me](mailto:nimrod@shore.co.il) or visit my Nimrod Adar, [contact me](mailto:nimrod@shore.co.il) or visit my
[website](https://www.shore.co.il/). Patches are welcome via [git [website](https://www.shore.co.il/). Patches are welcome via [git
send-email](http://git-scm.com/book/en/v2/Git-Commands-Email). The repository is send-email](http://git-scm.com/book/en/v2/Git-Commands-Email). The repository is
located at <https://git.shore.co.il/nimrod/>. located at <https://git.shore.co.il/explore>.
#!/usr/bin/env bats
export PATH="$BATS_TEST_DIRNAME/../:$PATH" export PATH="$BATS_TEST_DIRNAME/../:$PATH"
export repo="$BATS_TMPDIR/testrepo" export repo="$BATS_TMPDIR/testrepo"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment