Urho3D/.github/workflows/nightly.yml
Yao Wei Tjong 姚伟忠 3ea396ea65
CI - beat the cache eviction policy by 1 day.
[ci skip]
2021-07-20 13:26:35 +08:00

74 lines
2.7 KiB
YAML

#
# Copyright (c) 2008-2021 the Urho3D project.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
---
name: Nightly
on:
workflow_dispatch:
schedule: [ cron: '0 0 * * *' ]
jobs:
nightly:
name: Nightly build
runs-on: ubuntu-latest
env:
PUBLISHER_NAME: ${{ secrets.PUBLISHER_NAME }}
PUBLISHER_EMAIL: ${{ secrets.PUBLISHER_EMAIL }}
PUBLISHER_TOKEN: ${{ secrets.PUBLISHER_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
token: ${{ env.PUBLISHER_TOKEN }}
- name: Update dot files for DBE
id: update_dot_files
run: rake update_dot_files
- name: Check license
id: check_license
run: rake check_license
- name: Check cache
id: check_cache
run: |
last_run=$(date -d $(curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/urho3d/Urho3D/actions/workflows/2398550/runs 2>/dev/null |jq -r '.workflow_runs[0].created_at') '+%s')
now=$(date '+%s')
skip=$(( (now - last_run)/(60*60*24) < 7 ))
echo ::set-output name=skip::$skip
if: |
steps.update_dot_files.outputs.commit == '0' &&
steps.check_license.outputs.commit == '0'
- name: Push
run: git push
if: |
steps.update_dot_files.outputs.commit == '1' ||
steps.check_license.outputs.commit == '1'
- name: Dispatch
uses: peter-evans/repository-dispatch@v1.1.3
with:
token: ${{ env.PUBLISHER_TOKEN }}
repository: urho3d/Urho3D
event-type: 'Warm DBE build cache'
if: steps.check_cache.outputs.skip == '0'
...
# vi: set ts=2 sw=2 expandtab: