diff --git a/.ci/requirements.txt b/.ci/requirements.txt new file mode 100644 index 0000000..40e955c --- /dev/null +++ b/.ci/requirements.txt @@ -0,0 +1,4 @@ +markdown_link_extractor +testfixtures +pyyaml +pytest diff --git a/.github/workflows/check_format.yml b/.github/workflows/check_format.yml new file mode 100644 index 0000000..678653b --- /dev/null +++ b/.github/workflows/check_format.yml @@ -0,0 +1,30 @@ +name: Checks format +on: + push: + branches: + - main + pull_request: + branches: + - main +jobs: + Checks-format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - id: setup-python + name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Install dependencies + uses: py-actions/py-dependency-install@v2 + with: + path: ".ci/requirements.txt" + - name: Check files + run: python .ci/check_scripts.py + - name: test code + # Only run pytest when changes happened in the .ci directory + # it needs that checkout actions fetch all the branches (fetch-depth 0) to see main. + run: if $(git diff --name-only HEAD..origin/main | grep -q ".ci"); then pytest .ci/; fi diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index c8730c8..0000000 --- a/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: python -python: - - "3.7" -# command to install dependencies -install: - - pip install markdown_link_extractor testfixtures pyyaml -# command to run tests -script: - - python .ci/check_scripts.py - - if $(git diff --name-only HEAD..$TRAVIS_BRANCH | grep -q ".ci"); then pytest .ci/; fi