track_minetest #7403
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
name: track_minetest | |
# build on c/cpp changes or workflow changes | |
on: | |
schedule: | |
# Run every 3 hours | |
- cron: '0 */3 * * *' | |
push: | |
branches: | |
- master | |
# IMPORTANT: Do not run this workflow on pull request since this workflow | |
# has permission to modify contents. | |
permissions: | |
# deployments permission to deploy GitHub pages website | |
deployments: write | |
# contents permission to update benchmark contents in gh-pages branch | |
contents: write | |
jobs: | |
# Current gcc version | |
update_repo: | |
runs-on: ubuntu-22.04 | |
steps: | |
# Check out this repo | |
- uses: actions/checkout@v4 | |
- name: Update minetest revision | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
./update-revs.sh # sets MINETEST_REV | |
./push-revs.sh # sets DID_PUSH | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Checkout minetest | |
- uses: actions/checkout@v4 | |
if: ${{ env.DID_PUSH == 'true' }} | |
with: | |
repository: '${{ github.repository_owner }}/minetest' | |
ref: ${{ env.MINETEST_REV }} | |
path: 'minetest' | |
- name: Install deps | |
if: ${{ env.DID_PUSH == 'true' }} | |
run: | | |
pushd minetest | |
source ./util/ci/common.sh | |
install_linux_deps g++-12 | |
popd | |
- name: Build | |
if: ${{ env.DID_PUSH == 'true' }} | |
run: | | |
pushd minetest | |
./util/ci/build.sh | |
popd | |
env: | |
CC: gcc-12 | |
CXX: g++-12 | |
CMAKE_BUILD_TYPE: "Release" | |
CMAKE_BUILD_SERVER: FALSE | |
CMAKE_ENABLE_GETTEXT: FALSE | |
CMAKE_FLAGS: "-DBUILD_BENCHMARKS=TRUE" | |
- name: Run Benchmarks | |
if: ${{ env.DID_PUSH == 'true' }} | |
run: | | |
pushd minetest | |
./bin/minetest --run-benchmarks | tee ../output.txt | |
popd | |
# gh-pages branch is updated and pushed automatically with extracted benchmark data | |
- name: Store benchmark result | |
if: ${{ env.DID_PUSH == 'true' }} | |
uses: benchmark-action/github-action-benchmark@1846227a307d8c0149b960b986d46f8f4c95db0c | |
with: | |
name: Minetest Performance Benchmarks | |
tool: 'catch2' | |
output-file-path: output.txt | |
# Access token to deploy GitHub Pages branch | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
# Push and deploy GitHub pages branch automatically | |
auto-push: true | |
# If there's a regression, comment on the commit. | |
# Temporarily disabled due to a bug in github-action-benchmark | |
comment-on-alert: false | |
# Branch and path where benchmark is stored and updated. | |
# This corresponds to: | |
# https://minetest.github.io/minetest/dev/bench | |
gh-pages-branch: "gh-pages" | |
benchmark-data-dir-path: "dev/bench" |