Skip to content

Commit

Permalink
fix: run workflow only on PR and with cron
Browse files Browse the repository at this point in the history
  • Loading branch information
mihai-sysbio committed Mar 2, 2023
1 parent ecfdc30 commit 86a2472
Showing 1 changed file with 52 additions and 53 deletions.
105 changes: 52 additions & 53 deletions .github/workflows/validation.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
name: validation

on:
push:
pull-request:
schedule:
- cron: '0 0 * * *'

- cron: "0 0 * * *"

jobs:
setup:
Expand All @@ -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
Expand All @@ -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/[email protected]
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/[email protected]
with:
commit_user_name: validation-bot
commit_message: update validation results for ${{ matrix.gem }}
file_pattern: results/*.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 86a2472

Please sign in to comment.