Skip to content

Filter and sort objects (messages, posts, etc) by confirmation block ID #445 #1048

Filter and sort objects (messages, posts, etc) by confirmation block ID #445

Filter and sort objects (messages, posts, etc) by confirmation block ID #445 #1048

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Unit tests
on:
push:
branches:
- dev
- master
- "*"
pull_request:
branches:
- dev
- master
jobs:
tests:
runs-on: ubuntu-22.04
services:
postgres:
image: postgres:15.1
ports:
- 5432:5432
env:
POSTGRES_USER: aleph
POSTGRES_PASSWORD: decentralize-everything
POSTGRES_DATABASE: aleph
redis:
image: redis:7.0.10
ports:
- 127.0.0.1:6379:6379
steps:
- uses: actions/checkout@v2
with:
# Fetch the whole history for all tags and branches (required for aleph.__version__)
fetch-depth: 0
- name: Set up Python 3.11
id: setup-python
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Install latest Rust nightly toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rustfmt, clippy
- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-python-${{ steps.setup-python.outputs.python-version }}-pip-${{ hashFiles('setup.cfg') }}
- name: Install Python dependencies
run: |
rustup default nightly # Required to build some dependencies
pip install wheel
pip install --upgrade .[testing]
- name: Check types
run: |
mypy src/
- name: Check types in tests
run: |
mypy tests/
- name: Run unit tests
run: |
sudo cp .github/openssl-ci.cnf /etc/ssl/openssl.cnf
export OPENSSL_CONF=/etc/ssl/openssl.cnf
touch config.yml # Fake config file for alembic
pytest -v .
build:
runs-on: ubuntu-22.04
needs: tests
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Download Docker cache image (if available)
run: docker pull ghcr.io/$GITHUB_REPOSITORY/build-cache || true
- name: Build the Docker image
run: |
git fetch --prune --unshallow --tags
docker build . -t pyaleph-node:${GITHUB_REF##*/} -f deployment/docker-build/pyaleph.dockerfile --cache-from=ghcr.io/$GITHUB_REPOSITORY/build-cache
- name: Push the image to the cache
# It's not possible to push packages from fork PRs.
if: github.event.pull_request.head.repo.full_name == github.repository
run: |
docker tag pyaleph-node:${GITHUB_REF##*/} ghcr.io/$GITHUB_REPOSITORY/build-cache
docker push ghcr.io/$GITHUB_REPOSITORY/build-cache