Tests #46
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
# This workflow will build a Swift project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-swift | |
name: Tests | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
schedule: | |
- cron: '0 0 * * *' # every day at midnight | |
jobs: | |
build: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Sleep for a random duration (scheduled runs only) | |
if: github.event_name == 'schedule' | |
run: | | |
MAX_SLEEP=$((6 * 3600)) # Maximum sleep time of 6 hours | |
RANDOM_SLEEP=$(( RANDOM % MAX_SLEEP )) | |
echo "Sleeping for $RANDOM_SLEEP seconds..." | |
sleep $RANDOM_SLEEP | |
- name: Build | |
run: swift build -v | |
- name: Run tests | |
run: swift test -v |