Skip to content

Commit

Permalink
ci: configure commitlint
Browse files Browse the repository at this point in the history
Add commitlint to the project, so that we can auto generate changelogs
from now on.
  • Loading branch information
abatilo committed Jul 7, 2019
1 parent 15d4dbc commit 29d80a1
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/main.workflow
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ workflow "Publish typed_json_dataclass" {

workflow "PR Builder" {
on = "pull_request"
resolves = ["Run flake8", "Run pytest"]
resolves = ["Run flake8", "Run pytest", "Run commitlint"]
}

action "Install" {
Expand Down Expand Up @@ -44,3 +44,8 @@ action "Publish" {
secrets = ["PYPI_USERNAME", "PYPI_PASSWORD"]
args = ["publish", "--build", "--no-interaction", "-vv", "--username", "$PYPI_USERNAME", "--password", "$PYPI_PASSWORD"]
}

action "Run commitlint" {
uses = "./actions/make"
args = "commitlint"
}
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM node:8.15.0
WORKDIR /src
COPY package.json package-lock.json /src/
RUN npm ci
COPY .git /src/.git
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
SHELL := /bin/bash

CONTAINER_NAME = versioner

.PHONY: help
help: ## View help information
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

.PHONY: build
build: ## Build the container to run our commands within a container
docker build -t $(CONTAINER_NAME) -f ./Dockerfile .

.PHONY: commitlint
commitlint: build ## Verify that commits conform to our standard
docker run \
$(CONTAINER_NAME) \
npm run commitlint
10 changes: 10 additions & 0 deletions actions/make/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM docker:18.09.6
LABEL "com.github.actions.name"="Makefile runner"
LABEL "com.github.actions.description"="A docker base image that can run make"
LABEL "com.github.actions.icon"="code"
LABEL "com.github.actions.color"="gray-dark"
LABEL "maintainer"="abatilo"

RUN apk add make=4.2.1-r2 bash=5.0.0-r0
COPY ./entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]
2 changes: 2 additions & 0 deletions actions/make/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
sh -c "make $*"

0 comments on commit 29d80a1

Please sign in to comment.