Skip to content

scheduled-test

scheduled-test #265

name: scheduled-test
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
test:
strategy:
matrix:
os: [ ubuntu-latest ]
java: [ 11 ]
runs-on: ${{ matrix.os }}
env:
DISPLAY: :99
steps:
- name: Checkout GitHub repo
uses: actions/checkout@v3
with:
persist-credentials: false
fetch-depth: 0
- name: Set up Java
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
- name: Start Xvfb
if: matrix.os == 'ubuntu-latest'
run: Xvfb $DISPLAY &
- name: Run tests
run: mvn -B test
- name: Commit files
id: git
run: |
export CHANGES=$(git status -s)
if [ -n "$CHANGES" ]; then
git config --local user.email "boni.garcia@uc3m.es"
git config --local user.name "Boni Garcia"
git add docs/dataset.csv
git commit -m "Include new record in dataset (`date`)" -a
echo "::set-output name=commit::true"
fi
- name: Push changes
if: steps.git.outputs.commit == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}