hosts/.github/workflows/ci.yml
naveensrinivasan b742118cd1 Set permissions for GitHub actions
- Included permissions for the action. https://github.com/ossf/scorecard/blob/main/docs/checks.md#token-permissions

https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions

https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs

[Keeping your GitHub Actions and workflows secure Part 1: Preventing pwn requests](https://securitylab.github.com/research/github-actions-preventing-pwn-requests/)

 Restrict the GitHub token permissions only to the required ones; this way, even if the attackers will succeed in compromising your workflow, they won’t be able to do much.

Signed-off-by: naveensrinivasan <172697+naveensrinivasan@users.noreply.github.com>
2022-04-07 23:00:53 +00:00

56 lines
1.0 KiB
YAML

name: CI
on:
push:
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
test:
name: Python ${{ matrix.python }} on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python:
- '3.6'
- '3.7'
- '3.8'
- '3.9'
- '3.10'
os:
- ubuntu-latest
- macos-latest
- windows-latest
steps:
- name: Clone repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python }}
cache: pip
- name: Print versions
run: |
python --version
pip --version
- name: Install Python dependencies
run: pip install -r requirements.txt
- name: Run lint
run: flake8
- name: Run makeHosts.py
run: python makeHosts.py
- name: Run tests
run: python testUpdateHostsFile.py