-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
128 additions
and
0 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,50 @@ | ||
# Run acceptance-cycle on develop commits. | ||
# | ||
# Acceptance cycle comprises: | ||
# - run tests on develop | ||
# - release into main with bumped versions | ||
# | ||
name: Acceptance Cycle | ||
|
||
on: | ||
push: | ||
branches: | ||
- develop | ||
|
||
jobs: | ||
acceptance: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Test | ||
run: | | ||
cargo install cargo-tarpaulin | ||
cargo tarpaulin --out xml | ||
- name: Publish to Codecov | ||
uses: codecov/codecov-action@v4 | ||
|
||
- name: Documentation | ||
run: cargo doc --no-deps | ||
|
||
release: | ||
needs: acceptance | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Build | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Nigel Eke" | ||
git checkout main | ||
git merge develop | ||
cargo install cargo-workspaces | ||
cargo workspaces -v version --allow-branch main --yes patch |
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,25 @@ | ||
# Quick feedback for unit tests on non-main commits. | ||
# | ||
name: Commit Cycle | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- main | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Compile | ||
run: cargo build --verbose | ||
|
||
- name: Lint | ||
run: cargo clippy | ||
|
||
- name: Test | ||
run: cargo test --verbose -- --show-output |
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,53 @@ | ||
# Run publish-cycle on main commits. | ||
# | ||
# Publish cycle comprises: | ||
# - publish site, coverage reports and API documentation to https://nigeleke.github.io | ||
# | ||
name: Publish Cycle | ||
|
||
on: | ||
workflow_run: | ||
workflows: ["Acceptance Cycle"] | ||
branches: [develop] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Build | ||
run: | | ||
cargo doc --no-deps | ||
cargo install cargo-tarpaulin | ||
cargo tarpaulin --out html --output-dir target/coverage | ||
mkdir docs0 | ||
mkdir -p docs0/api | ||
mkdir -p docs0/coverage | ||
cp README.md docs0/ | ||
cp -R target/doc/* docs0/api | ||
cp -R target/coverage/tarpaulin-report.html docs0/coverage/index.html | ||
cargo tarpaulin --out xml | ||
- name: Publish to Codecov | ||
uses: codecov/codecov-action@v4 | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
- name: Publish | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Nigel Eke" | ||
export VERSION=$(git describe --abbrev=0 --tags) | ||
git checkout gh-pages | ||
rm -rf docs | ||
mv docs0 docs | ||
git add . | ||
git commit -m "Release $VERSION" | ||
git push |