Skip to content

Bump the pip group with 4 updates #35

Bump the pip group with 4 updates

Bump the pip group with 4 updates #35

Workflow file for this run

on:
pull_request:
repository_dispatch:
types: [ok-to-test-command]
name: Test Pull Request
jobs:
# Branch-based pull request
integration-trusted:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository
steps:
- name: Branch based PR checkout
uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install Flake8, pyTest & throne (from source)
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-cov
pip install .
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
env:
SHODAN_KEY: ${{ secrets.SHODAN_KEY }}
THRONE_USER: ${{ secrets.THRONE_USER }}
THRONE_PASS: ${{ secrets.THRONE_PASS }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
pytest -s -v tests/create_config.py && pytest -s -v
pytest --cov=./
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
# Repo owner has commented /ok-to-test on a (fork-based) pull request
integration-fork:
runs-on: ubuntu-latest
if:
github.event_name == 'repository_dispatch' &&
github.event.client_payload.slash_command.sha != '' &&
contains(github.event.client_payload.pull_request.head.sha, github.event.client_payload.slash_command.sha)
steps:
# Check out merge commit
- name: Fork based /ok-to-test checkout
uses: actions/checkout@v2
with:
ref: 'refs/pull/${{ github.event.client_payload.pull_request.number }}/merge'
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install Flake8, pyTest & throne (from source)
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pytest-cov
pip install .
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
env:
SHODAN_KEY: ${{ secrets.SHODAN_KEY }}
THRONE_USER: ${{ secrets.THRONE_USER }}
THRONE_PASS: ${{ secrets.THRONE_PASS }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
pytest -s -v tests/create_config.py && pytest -s -v
pytest --cov=./
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
# Update check run called "integration-fork"
- uses: actions/github-script@v1
id: update-check-run
if: ${{ always() }}
env:
number: ${{ github.event.client_payload.pull_request.number }}
job: ${{ github.job }}
conclusion: ${{ job.status }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { data: pull } = await github.pulls.get({
...context.repo,
pull_number: process.env.number
});
const ref = pull.head.sha;
const { data: checks } = await github.checks.listForRef({
...context.repo,
ref
});
const check = checks.check_runs.filter(c => c.name === process.env.job);
const { data: result } = await github.checks.update({
...context.repo,
check_run_id: check[0].id,
status: 'completed',
conclusion: process.env.conclusion
});
return result;