Upgrade to Pro — share decks privately, control downloads, hide ads and more …

New GitHub Features

New GitHub Features

8c3a2ebf7c2b84f8390d99c7bf8c8a48?s=128

Sobolev Nikita

June 13, 2021
Tweet

Transcript

  1. Никита Соболев github.com/sobolevn

  2. >_ X GitHub Actions

  3. Задача: прогоним линтер для Python проекта

  4. None
  5. name: Python package on: [push] jobs: build: runs-on: ubuntu-latest strategy:

    max-parallel: 4 matrix: python-version: [2.7, 3.5, 3.6, 3.7] steps: # ...
  6. name: Python package on: [push] jobs: build: runs-on: ubuntu-latest strategy:

    max-parallel: 4 matrix: python-version: [2.7, 3.5, 3.6, 3.7] steps: # ...
  7. name: Python package on: [push] jobs: build: runs-on: ubuntu-latest strategy:

    max-parallel: 4 matrix: python-version: [2.7, 3.5, 3.6, 3.7] steps: # ...
  8. name: Python package on: [push] jobs: build: runs-on: ubuntu-latest strategy:

    max-parallel: 4 matrix: python-version: [2.7, 3.5, 3.6, 3.7] steps: # ...
  9. Подготовка

  10. name: Python package # ... steps: - uses: actions/checkout@v1 -

    name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v1 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | pip install -r requirements.txt
  11. name: Python package # ... steps: - uses: actions/checkout@v1 -

    name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v1 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | pip install -r requirements.txt
  12. name: Python package # ... steps: - uses: actions/checkout@v1 -

    name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v1 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | pip install -r requirements.txt
  13. name: Python package # ... steps: - uses: actions/checkout@v1 -

    name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v1 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | pip install -r requirements.txt matrix: python-version: [2.7, 3.5, 3.6, 3.7]
  14. name: Python package # ... steps: - uses: actions/checkout@v1 -

    name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v1 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | pip install -r requirements.txt
  15. name: Python package # ... steps: - uses: actions/checkout@v1 -

    name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v1 with: python-version: ${{ matrix.python-version }} - name: Install dependencies run: | pip install -r requirements.txt
  16. Подготовились. Проверяем!

  17. name: Python package # ... steps: # ... - name:

    Lint with wemake-python-styleguide run: | pip install flake8 flake8 . - name: Test with pytest run: | pip install pytest pytest
  18. name: Python package # ... steps: # ... - name:

    Lint with wemake-python-styleguide run: | pip install flake8 flake8 . - name: Test with pytest run: | pip install pytest pytest
  19. None
  20. None
  21. None
  22. None
  23. Создай свое

  24. Dockerfile

  25. github.com/wemake- services/wemake- python-styleguide

  26. Но есть и готовые фреймворки

  27. Готовые npm компоненты

  28. Готовые npm компоненты > @actions/core

  29. Готовые npm компоненты > @actions/core > @actions/exec

  30. Готовые npm компоненты > @actions/core > @actions/exec > @actions/io

  31. Готовые npm компоненты > @actions/core > @actions/exec > @actions/io >

    @actions/tool-cache
  32. Готовые npm компоненты > @actions/core > @actions/exec > @actions/io >

    @actions/tool-cache > @actions/github
  33. 🚀

  34. github.com/sobolevn/ restrict-cursing- action

  35. sobolevn.me/talks/devoops-2019

  36. Внимание! Новинки!

  37. permissions: actions: read|write|none checks: read|write|none contents: read|write|none deployments: read|write|none issues:

    read|write|none packages: read|write|none pull-requests: read|write|none repository-projects: read|write|none security-events: read|write|none statuses: read|write|none GITHUB_TOKEN
  38. Deploy Environments

  39. None
  40. None
  41. >_ X GitHub Container Registry

  42. None
  43. >_ X GitHub Codespaces

  44. Позволяет запустить VSCode прям в браузере

  45. Очень удобно для определенного класса задач

  46. None
  47. None
  48. None
  49. Удобство 1: папка .devcontainer/

  50. { "name": "HypothesisWorks/hypothesis", "image": "python:3.8-slim-buster", "settings": { "python.pythonPath": "${workspaceFolder}/.venv/bin/python3", },

    // After container is created, we install all the requirements, // and show what commands there are in our own tooling: "postCreateCommand": "apt-get update && apt-get install -y make", }
  51. Удобство 2: синхронизация настроек

  52. Удобство 3: репозиторий dotfiles

  53. None
  54. github.com/sobolevn/ dotfiles

  55. >_ X GitHub Issue Forms

  56. У всех была вечная проблема: пользователи игнорировали все, что можно

    было игнорировать
  57. None
  58. None
  59. Скоро будет доступно для всех ;)

  60. >_ X GitHub Discussions

  61. Не каждый issue представляет собой ошибку или задачу

  62. Иногда мы хотим просто задать вопрос или обсудить что-то

  63. None
  64. None
  65. None
  66. >_ X GitHub Sponsors

  67. Удобный способ поддержать ваш любимый open-source проект

  68. None
  69. None
  70. sobolevn.me Вопросы? github.com/sobolevn