From 5e2948ce0dc0096c73675bc89375d076b37c618d Mon Sep 17 00:00:00 2001 From: David Perez-Suarez Date: Wed, 13 Oct 2021 20:21:23 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=8B=F0=9F=91=8B=20=F0=9F=91=B7=20Travi?= =?UTF-8?q?s=20-=20welcome=20:octocat:=F0=9F=8E=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .ci/requirements.txt | 4 ++++ .github/workflows/check_format.yml | 30 ++++++++++++++++++++++++++++++ .travis.yml | 10 ---------- 3 files changed, 34 insertions(+), 10 deletions(-) create mode 100644 .ci/requirements.txt create mode 100644 .github/workflows/check_format.yml delete mode 100644 .travis.yml 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