Skip to content

Instantly share code, notes, and snippets.

View Gr1N's full-sized avatar
🚴‍♂️

Nikita Grishko Gr1N

🚴‍♂️
View GitHub Profile
@Gr1N
Gr1N / gh-actions-services.yml
Last active January 12, 2020 12:43
10 things I love about GitHub Actions (services)
services:
postgres:
image: postgres:latest
ports:
- 5432/tcp
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
@Gr1N
Gr1N / gh-actions-secrets.yml
Created January 12, 2020 12:22
10 things I love about GitHub Actions (secrets)
steps:
- uses: appleboy/[email protected]
with:
to: ${{ secrets.TELEGRAM_CHAT_ID }}
token: ${{ secrets.TELEGRAM_BOT_TOKEN }}
message: ${{ github.repository }} starred!
@Gr1N
Gr1N / gh-actions-cache.yml
Created January 12, 2020 12:18
10 things I love about GitHub Actions (cache)
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: 3.8
- uses: actions/cache@v1
id: cache
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
@Gr1N
Gr1N / gh-actions-contexts-and-expressions.yml
Created January 12, 2020 12:17
10 things I love about GitHub Actions (contexts and expressions)
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- runs: pip install -U -r requirements.txt
@Gr1N
Gr1N / gh-actions-matrix-builds.yml
Created January 12, 2020 12:11
10 things I love about GitHub Actions (matrix-builds)
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- runs: pip install -U -r requirements.txt
@Gr1N
Gr1N / .drone.jsonnet
Created December 8, 2019 13:46
Why Drone CI can be interesting for you? Example of Drone CI configuration using Jsonnet
local
volume_cached_poetry_path = 'cached-poetry',
volume_cached_poetry_deps = 'cached-deps',
command_install = 'poetry install -vv',
command_test = 'poetry run pytest .',
step(name, commands, version='3.8') = {
name: '%s-%s' % [name, version],
image: 'python:%s' % version,
@Gr1N
Gr1N / bitbucket-pipelines.yml
Created December 8, 2019 13:42
Why Drone CI can be interesting for you? Example of Bitbucket Pipelines configuration using YAML anchors and aliases
definitions:
caches:
poetry-path: /root/.poetry
poetry-venv: /root/.cache/pypoetry/virtualenvs
steps:
- step: &step-37
image: python:3.7
caches:
- poetry-path
@Gr1N
Gr1N / bitbucket-pipelines.yml
Last active March 26, 2021 08:59
Why Drone CI can be interesting for you? Example of Bitbucket Pipelines configuration
definitions:
caches:
poetry-path: /root/.poetry
poetry-venv: /root/.cache/pypoetry/virtualenvs
pipelines:
default:
- step:
name: deps-3.7
image: python:3.7
@Gr1N
Gr1N / .gitlab-ci.yml
Created July 12, 2017 19:23
.gitlab-ci.yml example
image: themattrix/tox-base:latest
stages:
- test
py36-isort:
stage: test
script:
- tox -e py36-isort
tags:
import enum
import uuid
import arrow
import msgpack
@enum.unique
class Code(enum.IntEnum):
DATETIME_ISO8601 = 0