Skip to content

Commit e2be239

Browse files
committed
Define workflows for the project
Before stashing changes, the documentation will be generated. After making a commit, the full CI flow will be triggered. After a release, either a pull request for brew formulae will be submitted or the instructions will be printed. Also, the `version` file is removed before running a CI task in order to prevent a failure of the version test. For unit tests, the file is not expected. But after the installation, the file will be in the project's directory.
1 parent 3384c8f commit e2be239

8 files changed

Lines changed: 39 additions & 0 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.idea/
22
tmp/
33
site/
4+
version

.workflows/amend-work-after

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
save-work-after

.workflows/amend-work-ahead

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
save-work-ahead

.workflows/release-work-after

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env bash
2+
# add release notes
3+
open https://github.com/bees-hive/elegant-git/releases/new
4+
# update formulae
5+
TAG=$(git describe)
6+
COMMIT=$(git log --pretty=%H -1)
7+
8+
if type brew >/dev/null 2>&1 ; then
9+
info-text "Updating Homebrew formulae..."
10+
brew bump-formula-pr --no-audit --tag=${TAG} --revision=${COMMIT} elegant-git
11+
else
12+
error-text "brew binary is not available."
13+
error-text "Please make a manual formulae update."
14+
cat <<MESSAGE
15+
Instructions:
16+
17+
open https://github.com/bees-hive/homebrew-hive/blob/master/Formula/elegant-git.rb
18+
update
19+
git tag: ${TAG}
20+
git commit: ${COMMIT}
21+
MESSAGE
22+
fi

.workflows/save-work-after

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env bash
2+
./workflows ci

.workflows/save-work-ahead

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env bash
2+
./workflows generate-docs

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ something which should be quickly available, please propose changes here.
4646
**Table of contents**
4747

4848
- [Architecture](#architecture)
49+
- [Development environment](#development-environment)
4950
- [Coding rules](#coding-rules)
5051
- [Debug mode](#debug-mode)
5152
- [Testing procedure](#testing-procedure)
@@ -79,6 +80,12 @@ it. Each command file has to provide the following BASH functions:
7980
- `command-description` prints a command description (line length is limited to 80 characters)
8081
- `default` executes given command
8182

83+
### Development environment
84+
The following tools are needed for successful development:
85+
- Docker >= 19.03.2 is used for running tests
86+
- Python 3.x is needed for documentation previews
87+
- Elegant Git automates testing process and documentation generation
88+
8289
### Coding rules
8390
We enforce having a consistent implementation by following the next strict rules:
8491
- add `#!/usr/bin/env bash` at the beginning of each script

workflows

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ repository() {
3535
}
3636

3737
ci() {
38+
if [[ -f version ]]; then
39+
rm -v version
40+
fi
3841
docker run --rm -v $PWD:/eg ${WORKER_IMAGE} .workflows/ci-pipeline.bash testing
3942
}
4043

0 commit comments

Comments
 (0)