NightlyStatistics #58
This file contains hidden or 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
| # generated by praktika | |
| name: NightlyStatistics | |
| on: | |
| schedule: | |
| - cron: 13 5 * * * | |
| workflow_dispatch: | |
| concurrency: | |
| group: ${{ github.workflow }} | |
| env: | |
| PYTHONUNBUFFERED: 1 | |
| CHECKOUT_REF: "" | |
| jobs: | |
| config_workflow: | |
| runs-on: [self-hosted, style-checker-aarch64] | |
| needs: [] | |
| name: "Config Workflow" | |
| outputs: | |
| data: ${{ steps.run.outputs.DATA }} | |
| pipeline_status: ${{ steps.run.outputs.pipeline_status || 'undefined' }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ env.CHECKOUT_REF }} | |
| - name: Prepare env script | |
| run: | | |
| rm -rf ./ci/tmp | |
| mkdir -p ./ci/tmp | |
| cat > ./ci/tmp/praktika_setup_env.sh << 'ENV_SETUP_SCRIPT_EOF' | |
| export PYTHONPATH=./ci:.: | |
| cat > ./ci/tmp/workflow_job.json << 'EOF' | |
| ${{ toJson(job) }} | |
| EOF | |
| cat > ./ci/tmp/workflow_status.json << 'EOF' | |
| ${{ toJson(needs) }} | |
| EOF | |
| ENV_SETUP_SCRIPT_EOF | |
| - name: Run | |
| id: run | |
| run: | | |
| . ./ci/tmp/praktika_setup_env.sh | |
| set -o pipefail | |
| PYTHONUNBUFFERED=1 python3 -m praktika run 'Config Workflow' --workflow "NightlyStatistics" --ci 2>&1 | python3 -u -c 'import sys,datetime | |
| prefix=lambda: datetime.datetime.now().strftime("[%Y-%m-%d %H:%M:%S]") | |
| for line in sys.stdin: sys.stdout.write(prefix() + " " + line); sys.stdout.flush()' | tee ./ci/tmp/job.log | |
| collect_statistics: | |
| runs-on: [self-hosted, style-checker-aarch64] | |
| needs: [config_workflow] | |
| name: "Collect Statistics" | |
| outputs: | |
| data: ${{ steps.run.outputs.DATA }} | |
| pipeline_status: ${{ steps.run.outputs.pipeline_status || 'undefined' }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ env.CHECKOUT_REF }} | |
| - name: Prepare env script | |
| run: | | |
| rm -rf ./ci/tmp | |
| mkdir -p ./ci/tmp | |
| cat > ./ci/tmp/praktika_setup_env.sh << 'ENV_SETUP_SCRIPT_EOF' | |
| export PYTHONPATH=./ci:.: | |
| cat > ./ci/tmp/workflow_job.json << 'EOF' | |
| ${{ toJson(job) }} | |
| EOF | |
| cat > ./ci/tmp/workflow_status.json << 'EOF' | |
| ${{ toJson(needs) }} | |
| EOF | |
| ENV_SETUP_SCRIPT_EOF | |
| - name: Run | |
| id: run | |
| run: | | |
| . ./ci/tmp/praktika_setup_env.sh | |
| set -o pipefail | |
| PYTHONUNBUFFERED=1 python3 -m praktika run 'Collect Statistics' --workflow "NightlyStatistics" --ci 2>&1 | python3 -u -c 'import sys,datetime | |
| prefix=lambda: datetime.datetime.now().strftime("[%Y-%m-%d %H:%M:%S]") | |
| for line in sys.stdin: sys.stdout.write(prefix() + " " + line); sys.stdout.flush()' | tee ./ci/tmp/job.log |