Skip to content

CI

CI #2455

Workflow file for this run

name: CI
on:
push:
branches: [master]
tags: [v*.*, v*.*.*]
pull_request:
branches: [master]
pull_request_target:
branches: [master]
schedule:
- cron: 0 4 * * *
jobs:
test:
name: Run tests
runs-on: ubuntu-latest
if: |
(github.event_name != 'pull_request_target' && github.actor != 'dependabot[bot]') ||
(github.event_name == 'pull_request_target' && github.actor == 'dependabot[bot]')
env:
AWS_ACCOUNT_ID: ${{ secrets.AWS_ACCOUNT_ID }}
AWS_REGION: us-east-1
steps:
- name: Checkout commit
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Install python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Cache packages
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-py-3.9-${{ hashFiles('pyproject.toml', 'setup.cfg',
'requirements/*.txt') }}
- name: Cache pre-commit hooks
uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit|py3.9|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Install dependencies
run: make setup
- name: Lint
run: |
echo "::add-matcher::.github/actionlint-matcher.json"
make lint
- name: Run unit tests
run: make test_unit
- name: Login to ghcr.io
uses: docker/[email protected]
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- name: Run integration tests
run: make test_integration
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: .coverage-integration.xml
flags: integration
name: codecov-integration
- name: Build Docker image
run: make docker_build
- name: Upload image artifact
uses: neuro-inc/[email protected]
with:
image: platformneuroflowapi
token: ${{ secrets.GITHUB_TOKEN }}
release:
name: Create release
needs: test
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
uses: neuro-inc/reuse/.github/workflows/[email protected]
with:
image: platformneuroflowapi
helm_charts: platform-neuro-flow
deploy_dev:
name: Deploy on dev
needs: release
uses: neuro-inc/reuse/.github/workflows/[email protected]
with:
helm_charts: platform-neuro-flow
version: ${{ needs.release.outputs.version }}