Skip to content

Commit

Permalink
ci: Only run workflows once. Fix indentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Apr 2, 2021
1 parent cd0dda9 commit 424c288
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 33 deletions.
37 changes: 19 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,28 @@ name: CI
on: [push, pull_request]
jobs:
build:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
python-version: [3.6, 3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
# https://github.com/actions/cache/blob/main/examples.md#using-a-script-to-get-cache-location
- id: pip-cache
run: python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)"
- uses: actions/cache@v1
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
- run: pip install .[test]
- run: pytest --cov jscc --vcr-record=none tests
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: coveralls --service=github
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
# https://github.com/actions/cache/blob/main/examples.md#using-a-script-to-get-cache-location
- id: pip-cache
run: python -c "from pip._internal.locations import USER_CACHE_DIR; print('::set-output name=dir::' + USER_CACHE_DIR)"
- uses: actions/cache@v1
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-pip-
- run: pip install .[test]
- run: pytest --cov jscc --vcr-record=none tests
- env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: coveralls --service=github
31 changes: 16 additions & 15 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,21 @@ env:
BASEDIR: https://raw.githubusercontent.com/open-contracting/standard-maintenance-scripts/main
jobs:
build:
if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: 3.6
- uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('.github/workflows/lint.yml') }}
restore-keys: |
${{ runner.os }}-pip-
- run: curl -s -S --retry 3 $BASEDIR/tests/install.sh | bash -
- run: pip install .
- run: curl -s -S --retry 3 $BASEDIR/tests/script.sh | bash -
- run: pip install .[test]
- run: pytest /tmp/test_requirements.py
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: 3.6
- uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('.github/workflows/lint.yml') }}
restore-keys: |
${{ runner.os }}-pip-
- run: curl -s -S --retry 3 $BASEDIR/tests/install.sh | bash -
- run: pip install .
- run: curl -s -S --retry 3 $BASEDIR/tests/script.sh | bash -
- run: pip install .[test]
- run: pytest /tmp/test_requirements.py

0 comments on commit 424c288

Please sign in to comment.