Skip to content

Commit

Permalink
protect against empty changesets for post-release workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Hoß committed Jul 27, 2022
1 parent 8a257f9 commit cc4b19d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,17 @@ jobs:
name: Clone Git Repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # required in order to get all tags
fetch-depth: 0
- id: commits
name: Count Commits
run: echo "::set-output name=count::$(git rev-list --count HEAD --since='last Wednesday' -- yosql-codegen yosql-internals yosql-models yosql-tooling)"
- id: previous
name: Get Last Release
if: steps.commits.outputs.count > 0
run: echo "::set-output name=version::$(git describe --abbrev=0 --tags)"
- id: java
name: Setup Java
if: steps.commits.outputs.count > 0
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
Expand All @@ -35,6 +40,7 @@ jobs:
distribution: ${{ env.JAVA_DISTRO }}
- id: cache
name: Cache Maven Repository
if: steps.commits.outputs.count > 0
uses: actions/cache@v3
with:
path: ~/.m2/repository
Expand All @@ -43,21 +49,27 @@ jobs:
${{ runner.os }}-maven-
- id: run-benchmark
name: Run Benchmark [${{ matrix.benchmark }}]
if: steps.commits.outputs.count > 0
run: mvn --batch-mode --projects yosql-benchmarks/yosql-benchmarks-${{ matrix.benchmark }} --also-make --activate-profiles benchmarks verify --define org.slf4j.simpleLogger.log.yosql=warn --define skipTests 2>&1 1> build.log
- id: copy-codegen-results
name: Copy Codegen Results
if: steps.commits.outputs.count > 0
run: cp --force ./benchmark-codegen/yosql-benchmarks-codegen.json ./yosql-website/content/benchmarks/results/yosql-benchmarks-codegen-${{ steps.previous.outputs.version }}.json
- id: replace-codegen-results
name: Replace CURRENT Codegen Results
if: steps.commits.outputs.count > 0
run: cp --force ./benchmark-codegen/yosql-benchmarks-codegen.json ./yosql-website/content/benchmarks/results/yosql-benchmarks-codegen-CURRENT.json
- id: copy-jdbc-results
name: Copy JDBC Results
if: steps.commits.outputs.count > 0
run: cp --force ./benchmark-dao/yosql-benchmarks-dao.json ./yosql-website/content/benchmarks/results/yosql-benchmarks-dao-${{ steps.previous.outputs.version }}.json
- id: replace-jdbc-results
name: Replace CURRENT JDBC Results
if: steps.commits.outputs.count > 0
run: cp --force ./benchmark-dao/yosql-benchmarks-dao.json ./yosql-website/content/benchmarks/results/yosql-benchmarks-dao-CURRENT.json
- id: push
name: Push Changes
if: steps.commits.outputs.count > 0
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Update benchmark data for ${{ steps.previous.outputs.version }}
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/release-announcement.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@ jobs:
name: Clone Git Repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # required in order to get all tags
fetch-depth: 0
- id: commits
name: Count Commits
run: echo "::set-output name=count::$(git rev-list --count HEAD --since='last Wednesday' -- yosql-codegen yosql-internals yosql-models yosql-tooling)"
- id: previous
name: Get Last Release
if: steps.commits.outputs.count > 0
run: echo "::set-output name=version::$(git describe --abbrev=0 --tags)"
- id: email
name: Send Mail
if: steps.commits.outputs.count > 0
uses: dawidd6/action-send-mail@v3
with:
server_address: ${{ secrets.MAIL_SERVER }}
Expand All @@ -31,6 +36,7 @@ jobs:
body: See https://github.com/metio/yosql/releases/tag/${{ steps.previous.outputs.version }} for details.
- id: matrix
name: Send Matrix Message
if: steps.commits.outputs.count > 0
uses: s3krit/matrix-message-action@v0.0.3
with:
access_token: ${{ secrets.MATRIX_ACCESS_TOKEN }}
Expand Down

0 comments on commit cc4b19d

Please sign in to comment.