From 86a24723ccc84ffae0f7c28e85438d4356327eb5 Mon Sep 17 00:00:00 2001 From: Mihail Anton Date: Thu, 2 Mar 2023 17:00:14 +0100 Subject: [PATCH] fix: run workflow only on PR and with cron --- .github/workflows/validation.yml | 105 +++++++++++++++---------------- 1 file changed, 52 insertions(+), 53 deletions(-) diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index 043c745..0fe8e58 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -1,10 +1,9 @@ name: validation on: - push: + pull-request: schedule: - - cron: '0 0 * * *' - + - cron: "0 0 * * *" jobs: setup: @@ -13,30 +12,30 @@ jobs: matrix: ${{ steps.set-matrix.outputs.matrix }} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - + steps: - - name: Checkout repository - uses: actions/checkout@v2 - with: - fetch-depth: 1 + - name: Checkout repository + uses: actions/checkout@v2 + with: + fetch-depth: 1 + + - name: Set up Python 3 + uses: actions/setup-python@v2 + with: + python-version: "3.x" - - name: Set up Python 3 - uses: actions/setup-python@v2 - with: - python-version: '3.x' - - - name: Install dependencies - run: pip install -r requirements.txt + - name: Install dependencies + run: pip install -r requirements.txt - - id: set-matrix - run: echo "::set-output name=matrix::$(python -c 'import runner; runner.matrix()')" + - id: set-matrix + run: echo "::set-output name=matrix::$(python -c 'import runner; runner.matrix()')" - - name: Cache pip directory - uses: actions/cache@v2 - id: cache - with: - path: ~/.cache/pip - key: ${{ github.sha }} + - name: Cache pip directory + uses: actions/cache@v2 + id: cache + with: + path: ~/.cache/pip + key: ${{ github.sha }} validate: needs: setup @@ -50,37 +49,37 @@ jobs: max-parallel: 1 steps: - - name: Checkout repository - uses: actions/checkout@v2 - with: - fetch-depth: 1 - - - name: Set up Python 3 - uses: actions/setup-python@v2 - with: - python-version: '3.x' + - name: Checkout repository + uses: actions/checkout@v2 + with: + fetch-depth: 1 + + - name: Set up Python 3 + uses: actions/setup-python@v2 + with: + python-version: "3.x" + + - name: Restore pip cache directory + uses: actions/cache@v2 + id: cache + with: + path: ~/.cache/pip + key: ${{ github.sha }} - - name: Restore pip cache directory - uses: actions/cache@v2 - id: cache - with: - path: ~/.cache/pip - key: ${{ github.sha }} - - - name: Install dependencies - run: pip install -r requirements.txt + - name: Install dependencies + run: pip install -r requirements.txt - - name: Validate repository - run: python -c 'import runner; runner.validate("${{ matrix.gem }}")' + - name: Validate repository + run: python -c 'import runner; runner.validate("${{ matrix.gem }}")' - - name: Update branch - run: git pull --ff + - name: Update branch + run: git pull --ff - - name: Auto-commit results - uses: stefanzweifel/git-auto-commit-action@v4.4.0 - with: - commit_user_name: validation-bot - commit_message: update validation results for ${{ matrix.gem }} - file_pattern: results/*.json - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Auto-commit results + uses: stefanzweifel/git-auto-commit-action@v4.4.0 + with: + commit_user_name: validation-bot + commit_message: update validation results for ${{ matrix.gem }} + file_pattern: results/*.json + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}