-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci(workflows): migrate to the same files structure than other projects
- Loading branch information
1 parent
737df75
commit 8f9911f
Showing
3 changed files
with
108 additions
and
107 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
- main | ||
pull_request: | ||
branches: | ||
- "*" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
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 | ||
d |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
name: Test/Coverage with Python | ||
|
||
on: | ||
push: | ||
branches: | ||
- dev | ||
- main | ||
pull_request: | ||
branches: | ||
- "*" | ||
|
||
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@v4 | ||
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: Cache dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pytest-${{ hashFiles('pyproject.toml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pytest-${{ hashFiles('pyproject.toml') }} | ||
- run: | | ||
pip install hatch coverage | ||
- 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 | ||
# TODO: determine why ResourceWarning warnings occur in some tests. | ||
hatch run testing:test | ||
- run: | | ||
hatch run testing:cov | ||
- uses: codecov/[email protected] | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
slug: aleph-im/aleph-sdk-python |