Skip to content

Commit 85c41a4

Browse files
committed
ci: add actionlint and update docs
1 parent 286a62f commit 85c41a4

File tree

6 files changed

+62
-35
lines changed

6 files changed

+62
-35
lines changed

.github/CONTRIBUTING.md

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Before you begin, you will need to set up your local development environment. He
2020

2121
- [Pre-commit](https://pre-commit.com) — Automates the running of git pre-commit hooks.
2222
- Installation: `brew install pre-commit` and `make hooks`
23-
- [Cz-git](https://cz-git.qbb.sh) —Commitizen adapter, that assists in formatting git commits.
23+
- [Cz-git](https://cz-git.qbb.sh) Commitizen adapter, that assists in formatting git commits.
2424
- Installation: `brew install czg`
2525

2626
<br>
@@ -58,6 +58,10 @@ Refer to the output of `make help` for a comprehensive list of available command
5858
- **Fork the Repository**: Start by forking the repository to your GitHub account.
5959
- **Create a Branch**: In your fork, create a new branch for your work. Name it appropriately based on the feature, fix, or update you're working on.
6060
- **Make Your Changes**: Implement your changes, commit them, and push the branch to your fork.
61+
- **Run Tests**: Ensure all tests pass and the code adheres to the coding standards.
62+
- **Update Documentation**: If you've made changes that affect the project's documentation, ensure it is updated.
63+
- **Run Linters**: Ensure your code passes all linting checks using `make lint`.
64+
- **Commit Your Changes**: Use the [Conventional Commits](#-commit-message-guidelines) standard for your commit messages. You can use `make commit` to assist in creating commit messages.
6165
- **Open a Pull Request**: Submit a pull request to the `master` branch of the original repository. Ensure your PR is focused, addressing a single feature, fix, or improvement.
6266

6367
<br>
@@ -120,21 +124,21 @@ $ git commit -am 'fix: something has been fixed'
120124

121125
**Allowed Prefixes:**
122126

123-
| Prefix | Purpose |
124-
| ---------- | ------------------------------------------------------------ |
125-
| `feat` | Introduces a new feature |
126-
| `fix` | Fixes a bug |
127-
| `perf` | Improves performance |
128-
| `docs` | Documentation only changes |
129-
| `style` | Code style changes (formatting, missing semi-colons, etc.) |
130-
| `deps` | Updates dependencies |
131-
| `refactor` | Code changes that neither fixes a bug nor adds a feature |
132-
| `ci` | Changes to our CI configuration files and scripts |
133-
| `test` | Adding missing tests or correcting existing tests |
134-
| `revert` | Reverts a previous commit |
127+
| Prefix | Purpose |
128+
|------------|---------------------------------------------------------------|
129+
| `feat` | Introduces a new feature |
130+
| `fix` | Fixes a bug |
131+
| `perf` | Improves performance |
132+
| `docs` | Documentation only changes |
133+
| `style` | Code style changes (formatting, missing semi-colons, etc.) |
134+
| `deps` | Updates dependencies |
135+
| `refactor` | Code changes that neither fixes a bug nor adds a feature |
136+
| `ci` | Changes to our CI configuration files and scripts |
137+
| `test` | Adding missing tests or correcting existing tests |
138+
| `revert` | Reverts a previous commit |
135139
| `build` | Changes that affect the build system or external dependencies |
136-
| `chore` | Other changes that don't modify src or test files |
137-
| `security` | A code change that fixes a security issue |
140+
| `chore` | Other changes that don't modify src or test files |
141+
| `security` | A code change that fixes a security issue |
138142

139143
<br>
140144

@@ -164,6 +168,23 @@ $ make lint-yaml
164168

165169
by default, [`cytopia/yamllint`](https://github.com/cytopia/docker-yamllint) Docker image will be used to run linter.
166170

171+
<br>
172+
173+
### → Action Lint
174+
175+
We use [`actionlint`](https://github.com/rhysd/actionlint) to enforce coding standards in GitHub Actions workflows.
176+
177+
178+
To lint GitHub Actions run:
179+
180+
```bash
181+
$ make lint-actions
182+
```
183+
184+
by default, [`rhysd/actionlint`](https://hub.docker.com/r/rhysd/actionlint/tags) Docker image will be used to run linter.
185+
186+
<br>
187+
167188
### → PHP CS Fixer
168189

169190
We use [`friendsofphp/php-cs-fixer`](https://github.com/FriendsOfPHP/PHP-CS-Fixer) together with [`wayofdev/php-cs-fixer-config`](https://github.com/wayofdev/php-cs-fixer-config) to enforce coding standards in PHP files.

.github/ISSUE_TEMPLATE.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

.github/workflows/integrate.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ jobs:
9090

9191
coding-standards:
9292
timeout-minutes: 4
93-
runs-on: ubuntu-latest
93+
runs-on: ${{ matrix.os }}
9494
concurrency:
9595
cancel-in-progress: true
9696
group: coding-standards-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -209,7 +209,7 @@ jobs:
209209
trust-gpg-keys: '0x033E5F8D801A2F8D'
210210

211211
- name: 🔬 Run maglnet/composer-require-checker
212-
run: .phive/composer-require-checker check --ansi --config-file=$(pwd)/composer-require-checker.json --verbose
212+
run: .phive/composer-require-checker check --ansi --config-file="$(pwd)"/composer-require-checker.json --verbose
213213

214214
mutation-testing:
215215
timeout-minutes: 16

Makefile

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,19 @@
55
# https://docs.docker.com/compose/environment-variables/envvars/
66
export DOCKER_BUILDKIT ?= 1
77

8+
# Docker binary to use, when executing docker tasks
9+
DOCKER ?= docker
10+
811
# Binary to use, when executing docker-compose tasks
9-
DOCKER_COMPOSE ?= docker compose
12+
DOCKER_COMPOSE ?= $(DOCKER) compose
1013

1114
# Support image with all needed binaries, like envsubst, mkcert, wait4x
1215
SUPPORT_IMAGE ?= wayofdev/build-deps:alpine-latest
1316

1417
APP_RUNNER ?= $(DOCKER_COMPOSE) run --rm --no-deps app
1518
APP_COMPOSER ?= $(APP_RUNNER) composer
1619

17-
BUILDER_PARAMS ?= docker run --rm -i \
20+
BUILDER_PARAMS ?= $(DOCKER) run --rm -i \
1821
--env-file ./.env \
1922
--env COMPOSE_PROJECT_NAME=$(COMPOSE_PROJECT_NAME) \
2023
--env COMPOSER_AUTH="$(COMPOSER_AUTH)"
@@ -26,11 +29,17 @@ BUILDER_WIRED ?= $(BUILDER_PARAMS) --network project.$(COMPOSE_PROJECT_NAME) $(S
2629
ENVSUBST ?= $(BUILDER) envsubst
2730

2831
# Yamllint docker image
29-
YAML_LINT_RUNNER ?= docker run --rm $$(tty -s && echo "-it" || echo) \
32+
YAML_LINT_RUNNER ?= $(DOCKER) run --rm $$(tty -s && echo "-it" || echo) \
3033
-v $(PWD):/data \
3134
cytopia/yamllint:latest \
3235
-f colored .
3336

37+
ACTION_LINT_RUNNER ?= $(DOCKER) run --rm $$(tty -s && echo "-it" || echo) \
38+
-v $(shell pwd):/repo \
39+
--workdir /repo \
40+
rhysd/actionlint:latest \
41+
-color
42+
3443
PHIVE_RUNNER ?= $(DOCKER_COMPOSE) run --rm --no-deps app
3544

3645
NPM_RUNNER ?= pnpm
@@ -68,7 +77,7 @@ MAKE_CMD_COLOR := $(BLUE)
6877

6978
default: all
7079

71-
help:
80+
help: ## Show this menu
7281
@echo 'Management commands for package:'
7382
@echo 'Usage:'
7483
@echo ' ${MAKE_CMD_COLOR}make${RST} Setups dependencies for fresh-project, like composer install, git hooks and others...'
@@ -168,13 +177,17 @@ hooks: ## Install git hooks from pre-commit-config
168177
pre-commit autoupdate
169178
.PHONY: hooks
170179

171-
lint: lint-yaml lint-php lint-stan lint-composer lint-audit ## Runs all linting commands
180+
lint: lint-yaml lint-actions lint-php lint-stan lint-composer lint-audit ## Runs all linting commands
172181
.PHONY: lint
173182

174183
lint-yaml: ## Lints yaml files inside project
175184
@$(YAML_LINT_RUNNER)
176185
.PHONY: lint-yaml
177186

187+
lint-actions: ## Lint all github actions
188+
@$(ACTION_LINT_RUNNER)
189+
.PHONY: lint-actions
190+
178191
lint-php: prepare ## Fixes code to follow coding standards using php-cs-fixer
179192
$(APP_COMPOSER) cs:fix
180193
.PHONY: lint-php

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,3 +174,9 @@ You are more than welcome. Before contributing, kindly check our [contribution g
174174
Created in **2022** by [lotyp](https://github.com/wayofdev) @ [wayofdev](https://github.com/wayofdev)
175175

176176
<br>
177+
178+
## 🫡 Contributors
179+
180+
<img align="left" src="https://img.shields.io/github/contributors-anon/wayofdev/laravel-package-tpl?style=for-the-badge" alt="Contributors Badge"/>
181+
182+
<br>

0 commit comments

Comments
 (0)