diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..0c30002 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,61 @@ +name: Test + +on: + push: + branches: + - '*' + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + pip install --upgrade pytest coverage mypy + pip install --upgrade -r requirements.txt + - name: Run mypy + run: mypy updater + - name: Run tests with coverage + run: | + coverage run --source . --omit conf.py -m pytest --junitxml=report.xml + coverage report + coverage xml + - name: Upload test reports + uses: actions/upload-artifact@v4 + with: + name: test-reports-${{ matrix.python-version }} + path: | + report.xml + coverage.xml + + build-docs: + runs-on: ubuntu-latest + container: python:latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.12' + - name: Install dependencies + run: | + pip install --upgrade sphinx + pip install --upgrade -r requirements.txt + - name: Build docs + run: | + make html + mv -f _build/html public + - name: Upload docs + uses: actions/upload-artifact@v4 + with: + name: built-docs + path: public + retention-days: 1 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index ed784aa..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,60 +0,0 @@ -stages: - - test - - doc - -test:mipy: - stage: test - tags: - - linux - image: python:3.7 - interruptible: true - script: - - 'pip install --upgrade mypy pytest' - - 'pip install --upgrade -r requirements.txt' - - 'mypy updater' - only: - - branches@manuelcortez/updater - - release - - tags - - schedules - -test:pytest: - stage: test - tags: - - linux - image: python:3.8 - interruptible: true - script: - - 'pip install --upgrade pytest coverage' - - 'pip install --upgrade -r requirements.txt' - - 'coverage run --source . --omit conf.py -m pytest --junitxml=report.xml' - - 'coverage report' - - 'coverage xml' - only: - - branches@manuelcortez/updater - - release - - tags - - schedules - artifacts: - when: always - reports: - junit: report.xml - cobertura: coverage.xml - -pages: - image: python:latest - tags: - - docker - interruptible: true - only: - - main - stage: doc - script: - - 'pip install --upgrade sphinx' - - 'pip install --upgrade -r requirements.txt' - - 'make html' - - 'mv -f _build/html public' - artifacts: - expire_in: 1 day - paths: - - public \ No newline at end of file