-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #275 from myii/feat/replace-Travis-CI-with-GitLab-CI
feat: replace Travis CI with GitLab CI
- Loading branch information
Showing
22 changed files
with
1,155 additions
and
285 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
# -*- coding: utf-8 -*- | ||
# vim: ft=yaml | ||
--- | ||
############################################################################### | ||
# Define all YAML node anchors | ||
############################################################################### | ||
.node_anchors: | ||
# `only` (also used for `except` where applicable) | ||
only_branch_master_parent_repo: &only_branch_master_parent_repo | ||
- 'master@myii/ssf-formula' | ||
# `stage` | ||
stage_lint: &stage_lint 'lint' | ||
stage_release: &stage_release 'release' | ||
# `image` | ||
image_commitlint: &image_commitlint 'myii/ssf-commitlint:11' | ||
image_precommit: &image_precommit | ||
name: 'myii/ssf-pre-commit:2.9.2' | ||
entrypoint: ['/bin/bash', '-c'] | ||
image_semantic-release: &image_semanticrelease 'myii/ssf-semantic-release:15.14' | ||
|
||
############################################################################### | ||
# Define stages and global variables | ||
############################################################################### | ||
stages: | ||
- *stage_lint | ||
- *stage_release | ||
variables: | ||
DOCKER_DRIVER: 'overlay2' | ||
|
||
############################################################################### | ||
# `lint` stage: `commitlint` & `pre-commit` | ||
############################################################################### | ||
commitlint: | ||
stage: *stage_lint | ||
image: *image_commitlint | ||
script: | ||
# Add `upstream` remote to get access to `upstream/master` | ||
- 'git remote add upstream ${CI_PROJECT_URL}.git' | ||
- 'git fetch --all' | ||
# Set default commit hashes for `--from` and `--to` | ||
- 'export COMMITLINT_FROM="$(git merge-base upstream/master HEAD)"' | ||
- 'export COMMITLINT_TO="${CI_COMMIT_SHA}"' | ||
# `coqbot` adds a merge commit to test PRs on top of the latest commit in | ||
# the repo; amend this merge commit message to avoid failure | ||
- | | ||
if [ "${GITLAB_USER_LOGIN}" = "coqbot" ] \ | ||
&& [ "${CI_COMMIT_BRANCH}" != "master" ]; then | ||
git commit --amend -m \ | ||
'chore: reword coqbot merge commit message for commitlint' | ||
export COMMITLINT_TO=HEAD | ||
fi | ||
# Run `commitlint` | ||
- 'commitlint --from "${COMMITLINT_FROM}" | ||
--to "${COMMITLINT_TO}" | ||
--verbose' | ||
|
||
pre-commit: | ||
stage: *stage_lint | ||
image: *image_precommit | ||
# https://pre-commit.com/#gitlab-ci-example | ||
variables: | ||
PRE_COMMIT_HOME: '${CI_PROJECT_DIR}/.cache/pre-commit' | ||
cache: | ||
key: '${CI_JOB_NAME}' | ||
paths: | ||
- '${PRE_COMMIT_HOME}' | ||
script: | ||
- 'pre-commit run --all-files --color always --verbose' | ||
|
||
############################################################################### | ||
# `release` stage: `semantic-release` | ||
############################################################################### | ||
semantic-release: | ||
only: *only_branch_master_parent_repo | ||
stage: *stage_release | ||
image: *image_semanticrelease | ||
variables: | ||
MAINTAINER_TOKEN: '${GH_TOKEN}' | ||
script: | ||
# Update `AUTHORS.md` | ||
- '${HOME}/go/bin/maintainer contributor' | ||
# Run `semantic-release` | ||
- 'semantic-release' |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.