Skip to content

Commit

Permalink
Replace Travis CI with GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
cytopia committed Nov 21, 2020
1 parent 846e620 commit af0dbe2
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 25 deletions.
31 changes: 31 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# top-most EditorConfig file
root = true

# Default for all files
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

# Custom files
[*.py]
indent_style = space
indent_size = 4

[.sh}]
indent_style = tab
indent_size = 4

[Makefile]
indent_style = tab
indent_size = 4

[*.{yml,yaml}]
indent_style = space
indent_size = 2

[*.md]
indent_style = space
trim_trailing_whitespace = false
indent_size = 2
34 changes: 34 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---

###
### Lints all generic and json files in the whole git repository
###

name: linting
on:
pull_request:
push:
branches:
- master
tags:

jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: False
matrix:
target:
- Linting
name: "[ ${{ matrix.target }} ]"
steps:
- name: Checkout repository
uses: actions/checkout@master

- name: Lint files
run: |
make _lint-files
- name: Shellcheck
run: |
make _lint-shell
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

45 changes: 45 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
ifneq (,)
.error This Makefile requires GNU Make.
endif

# -------------------------------------------------------------------------------------------------
# Default configuration
# -------------------------------------------------------------------------------------------------
.PHONY: help lint

FL_VERSION = 0.3
FL_IGNORES = .git/,.github/


# -------------------------------------------------------------------------------------------------
# Default Target
# -------------------------------------------------------------------------------------------------
help:
@echo "lint Lint repository"


# -------------------------------------------------------------------------------------------------
# Lint Targets
# -------------------------------------------------------------------------------------------------
lint: _lint-files
lint: _lint-shell


.PHONY: _lint-files
_lint-files:
@echo "# -------------------------------------------------------------------- #"
@echo "# Lint files"
@echo "# -------------------------------------------------------------------- #"
@docker run --rm $$(tty -s && echo "-it" || echo) -v $(PWD):/data cytopia/file-lint:$(FL_VERSION) file-cr --text --ignore '$(FL_IGNORES)' --path .
@docker run --rm $$(tty -s && echo "-it" || echo) -v $(PWD):/data cytopia/file-lint:$(FL_VERSION) file-crlf --text --ignore '$(FL_IGNORES)' --path .
@docker run --rm $$(tty -s && echo "-it" || echo) -v $(PWD):/data cytopia/file-lint:$(FL_VERSION) file-trailing-single-newline --text --ignore '$(FL_IGNORES)' --path .
@docker run --rm $$(tty -s && echo "-it" || echo) -v $(PWD):/data cytopia/file-lint:$(FL_VERSION) file-trailing-space --text --ignore '$(FL_IGNORES)' --path .
@docker run --rm $$(tty -s && echo "-it" || echo) -v $(PWD):/data cytopia/file-lint:$(FL_VERSION) file-utf8 --text --ignore '$(FL_IGNORES)' --path .
@docker run --rm $$(tty -s && echo "-it" || echo) -v $(PWD):/data cytopia/file-lint:$(FL_VERSION) file-utf8-bom --text --ignore '$(FL_IGNORES)' --path .

.PHONY: _lint-shell
_lint-shell:
@echo "# -------------------------------------------------------------------- #"
@echo "# Shellcheck"
@echo "# -------------------------------------------------------------------- #"
@docker run --rm $$(tty -s && echo "-it" || echo) -v $(PWD):/mnt -w /mnt koalaman/shellcheck:stable watcherd

0 comments on commit af0dbe2

Please sign in to comment.