-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: run workflow only on PR and with cron
- Loading branch information
1 parent
ecfdc30
commit 86a2472
Showing
1 changed file
with
52 additions
and
53 deletions.
There are no files selected for viewing
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
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: | ||
|
@@ -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/[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 }} |