ci.yaml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. name: CI
  2. on:
  3. pull_request:
  4. push:
  5. branches: [main]
  6. tags: ['v*']
  7. jobs:
  8. # mypy:
  9. # if: ${{ !github.event.pull_request.draft }}
  10. # runs-on: ubuntu-latest
  11. # steps:
  12. # - name: Check out repository
  13. # uses: actions/checkout@v3
  14. # - uses: ./.github/actions/setup
  15. # with:
  16. # os: "ubuntu-latest"
  17. # python-version: "3.9"
  18. # venv-id: "docs"
  19. # poetry-dependency-install-flags: "--all-extras --only 'main,dev'"
  20. # - name: mypy
  21. # run: MYPYPATH=stubs poetry run mypy src
  22. docs:
  23. if: ${{ !github.event.pull_request.draft }}
  24. runs-on: ubuntu-latest
  25. steps:
  26. - name: Check out repository
  27. uses: actions/checkout@v3
  28. - uses: ./.github/actions/setup
  29. with:
  30. os: "ubuntu-latest"
  31. python-version: "3.9"
  32. venv-id: "docs"
  33. poetry-dependency-install-flags: "--all-extras --only 'main,docs'"
  34. - name: docs
  35. run: poetry run sphinx-build -W --keep-going -T -b html docs/source docs/build
  36. # tests:
  37. # strategy:
  38. # fail-fast: false
  39. # matrix:
  40. # os: [ "ubuntu-latest" ]
  41. # python-version: [ "3.9", "3.10", "3.11" ]
  42. # runs-on: "${{ matrix.os }}"
  43. # defaults:
  44. # run:
  45. # # This might be needed for Windows and doesn't seem to affect unix-based systems
  46. # # so we include it. If you have better proof of whether this is needed or not,
  47. # # feel free to update.
  48. # shell: bash
  49. # steps:
  50. # - name: Check out repository
  51. # uses: actions/checkout@v3
  52. # - uses: ./.github/actions/setup
  53. # with:
  54. # os: "${{ matrix.os }}"
  55. # python-version: "${{ matrix.python-version }}"
  56. # venv-id: "tests-${{ runner.os }}"
  57. # poetry-dependency-install-flags: "--all-extras"
  58. # - name: Run tests
  59. # run: |
  60. # poetry run pytest -r a -v src tests --doctest-modules --cov=src --cov-report=term-missing --cov-report=xml
  61. # poetry run coverage report
  62. # - name: Upload coverage reports to Codecov
  63. # uses: codecov/codecov-action@v3
  64. # imports-without-extras:
  65. # strategy:
  66. # fail-fast: false
  67. # matrix:
  68. # os: [ "ubuntu-latest" ]
  69. # python-version: [ "3.9", "3.10", "3.11" ]
  70. # runs-on: "${{ matrix.os }}"
  71. # steps:
  72. # - name: Check out repository
  73. # uses: actions/checkout@v3
  74. # - uses: ./.github/actions/setup
  75. # with:
  76. # python-version: "${{ matrix.python-version }}"
  77. # venv-id: "imports-without-extras-${{ runner.os }}"
  78. # poetry-dependency-install-flags: "--only main"
  79. # - name: Check importable without extras
  80. # run: poetry run python scripts/test-install.py
  81. #
  82. # check-build:
  83. # runs-on: ubuntu-latest
  84. # steps:
  85. # - name: Check out repository
  86. # uses: actions/checkout@v3
  87. # - uses: ./.github/actions/setup
  88. # with:
  89. # python-version: "3.9"
  90. # venv-id: "check-build-${{ runner.os }}"
  91. # run-poetry-install: false
  92. # poetry-dependency-install-flags: "not used"
  93. # - name: Build package
  94. # run: |
  95. # poetry build --no-interaction
  96. # - name: Check build
  97. # run: |
  98. # tar -tvf dist/unfccc_ghg_data-*.tar.gz --wildcards '*unfccc_ghg_data/py.typed'
  99. # tar -tvf dist/unfccc_ghg_data-*.tar.gz --wildcards 'unfccc_ghg_data-*/LICENCE'
  100. # check-dependency-licences:
  101. # runs-on: ubuntu-latest
  102. # steps:
  103. # - name: Check out repository
  104. # uses: actions/checkout@v3
  105. # - uses: ./.github/actions/setup
  106. # with:
  107. # python-version: "3.9"
  108. # venv-id: "licence-check"
  109. # poetry-dependency-install-flags: "--all-extras"
  110. # - name: Check licences of dependencies
  111. # shell: bash
  112. # run: |
  113. # TEMP_FILE=$(mktemp)
  114. # poetry export --without=tests --without=docs --without=dev > $TEMP_FILE
  115. # poetry run liccheck -r $TEMP_FILE -R licence-check.txt
  116. # cat licence-check.txt