Add ecr auto push #50
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
workflow_dispatch: | |
inputs: | |
debug_enabled: | |
description: "Run the build with tmate debugging enabled" | |
required: false | |
jobs: | |
linting: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cancel previous workflows that are still running | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- name: Checkout latest commit | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 # fetch all history with version tags | |
- name: Set up python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: "3.10" | |
- name: Set up pip cache | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pip | |
key: ${{ matrix.tox-env }}-${{ runner.os }} | |
- name: Set up environment | |
run: | | |
pip install --upgrade pip wheel setuptools | |
pip install bandit[toml]==1.7.4 ruff==0.5.5 | |
- name: Linting check | |
run: | | |
bandit -qr -c pyproject.toml src/ | |
ruff check src/ tests/ | |
ruff format --check src/ tests | |
unit-tests: | |
runs-on: ${{ matrix.os }} | |
services: | |
elasticsearch: | |
image: docker.elastic.co/elasticsearch/elasticsearch:8.7.1 | |
env: | |
discovery.type: single-node | |
xpack.security.enabled: false | |
options: >- | |
--health-cmd "curl http://localhost:9200/_cluster/health" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 10 | |
ports: | |
- 9201:9200 | |
opensearch: | |
image: opensearchproject/opensearch:2.5.0 | |
env: | |
discovery.type: single-node | |
plugins.security.disabled: true | |
options: >- | |
--health-cmd "curl http://localhost:9200" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 10 | |
ports: | |
- 9200:9200 | |
redis: | |
image: redis:7.2.3 | |
options: >- | |
--health-cmd "redis-cli ping" | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 10 | |
ports: | |
- 6380:6379 | |
env: | |
PIP_CACHE_DIR: .cache/pip | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ["3.10"] | |
steps: | |
- name: Cancel previous workflows that are still running | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ github.token }} | |
- name: Checkout latest commit | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 # fetch all history with version tags | |
- name: Set up python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Set up pip cache | |
uses: actions/cache@v2 | |
with: | |
path: .cache/pip | |
key: ${{ matrix.tox-env }}-${{ matrix.os }} | |
- name: Set up environment | |
run: | | |
pip install --upgrade pip | |
pip install mypy==1.8.0 | |
pip install -e ".[dev]" | |
- name: Running mypy and tests | |
run: | | |
mypy src/ | |
pytest --color=yes |