CI #3291
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: | |
push: | |
branches: [master] | |
tags: [v*.*, v*.*.*] | |
pull_request: | |
branches: [master] | |
schedule: | |
- cron: 0 4 * * * | |
jobs: | |
test: | |
name: Run tests | |
runs-on: ubuntu-latest | |
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-file: .python-version | |
- name: Cache packages | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cache/pip | |
key: ${{ runner.os }}-py-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('setup.cfg') }} | |
- name: Install dependencies | |
run: make setup | |
- name: Install MC (minio client) | |
run: | | |
sudo apt-get -q update | |
sudo apt-get -q install -y wget | |
wget -O mc https://dl.min.io/client/mc/release/linux-amd64/archive/mc.RELEASE.2023-02-28T00-12-59Z | |
sudo chmod +x mc | |
sudo mv mc /usr/bin/mc | |
- 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/login-action@v3.0.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ github.token }} | |
- name: Setup minikube | |
run: | | |
make install_k8s | |
make start_k8s | |
make apply_configuration_k8s | |
make test_k8s | |
- name: Run integration tests | |
env: | |
# Azure account is disabled | |
# AZURE_STORAGE_ACCOUNT_URL: ${{ secrets.AZURE_STORAGE_ACCOUNT_URL }} | |
# AZURE_STORAGE_CREDENTIAL: ${{ secrets.AZURE_STORAGE_CREDENTIAL }} | |
GCLOUD_SA_KEY_JSON_B64: ${{ secrets.GCLOUD_SA_KEY_JSON_B64 }} | |
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/upload-image-action@v24.4.0 | |
with: | |
image: platformbucketsapi | |
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/release-service.yaml@v24.10.0 | |
with: | |
image: platformbucketsapi | |
helm_charts: platform-buckets | |
deploy_dev: | |
name: Deploy on dev | |
needs: release | |
uses: neuro-inc/reuse/.github/workflows/deploy-dev.yaml@v0.0.31 | |
with: | |
helm_charts: platform-buckets | |
version: ${{ needs.release.outputs.version }} |