From 3a795e585affd982fbbfd0a188df0d7b76b328f6 Mon Sep 17 00:00:00 2001 From: Evan Read Date: Mon, 30 May 2022 10:35:47 +0000 Subject: Split Make targets for tests --- .gitlab-ci.yml | 10 +++++----- Makefile | 16 +++++++++++++++- lefthook.yml | 17 +++++++++++++++-- 3 files changed, 35 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9a24ee9e..5a9bd8a0 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -297,7 +297,7 @@ rspec: stage: test script: - yarn install --cache-folder .yarn-cache - - bundle exec rspec + - make rspec-tests # # Run JavaScript tests @@ -310,7 +310,7 @@ jest: needs: [] stage: test script: - - yarn test + - make jest-tests # # Lint JavaScript @@ -323,8 +323,8 @@ js_lint: needs: [] stage: test script: - - yarn eslint - - yarn prettier + - make eslint-tests + - make prettier-tests # # Lint SCSS @@ -337,7 +337,7 @@ stylelint: needs: [] stage: test script: - - scripts/run-stylelint.sh + - make stylelint-tests # # Yamllint of *.yml for .gitlab-ci.yml. diff --git a/Makefile b/Makefile index 75400fdf..d8ef0b7f 100644 --- a/Makefile +++ b/Makefile @@ -95,18 +95,32 @@ brew-bundle: @printf "\n$(INFO)INFO: Checking Brew dependencies, if Brew is available..$(INFO_END)\n" @(command -v brew > /dev/null 2>&1) && brew bundle --no-lock || true -test: setup brew-bundle +rspec-tests: @printf "\n$(INFO)INFO: Running RSpec tests..$(INFO_END)\n" @bundle exec rspec + +jest-tests: @printf "\n$(INFO)INFO: Running Jest tests..$(INFO_END)\n" @yarn test + +eslint-tests: @printf "\n$(INFO)INFO: Running ESLint tests..$(INFO_END)\n" @yarn eslint + +prettier-tests: @printf "\n$(INFO)INFO: Running Prettier tests..$(INFO_END)\n" @yarn prettier + +stylelint-tests: @printf "\n$(INFO)INFO: Running Stylelint tests..$(INFO_END)\n" @scripts/run-stylelint.sh + +hadolint-tests: @printf "\n$(INFO)INFO: Running hadolint tests..$(INFO_END)\n" @hadolint latest.Dockerfile .gitpod.Dockerfile **/*.Dockerfile + +yamllint-tests: @printf "\n$(INFO)INFO: Running yamllint tests..$(INFO_END)\n" @yamllint .gitlab-ci.yml content/_data + +test: setup brew-bundle rspec-test jest-tests eslint-tests prettier-tests stylelint-tests hadolint-tests yamllint-tests diff --git a/lefthook.yml b/lefthook.yml index 3a543eb0..db3a667e 100644 --- a/lefthook.yml +++ b/lefthook.yml @@ -1,5 +1,18 @@ --- pre-push: commands: - tests: - run: make test + parallel: true + rspec-tests: + run: make rspec-tests + jest-tests: + run: make jest-tests + eslint-tests: + run: make eslint-tests + prettier-tests: + run: make prettier-tests + stylelint-tests: + run: make stylelint-tests + hadolint-tests: + run: make hadolint-tests + yamllint-tests: + run: make yamllint-tests -- cgit v1.2.3