-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from ff137/lint-and-test-workflow
👷 Create lint and test workflow
- Loading branch information
Showing
11 changed files
with
157 additions
and
65 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
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,72 @@ | ||
name: Lint and test | ||
|
||
on: | ||
# Manual dispatch option: | ||
workflow_dispatch: | ||
# Trigger the workflow only for pull requests for the main branch | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
style: | ||
name: Python linting | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.9 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.9 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install \ | ||
isort~=5.13.2 \ | ||
black~=24.2.0 | ||
- name: Check import style with isort | ||
run: | | ||
isort . --check --profile black --diff | ||
- name: Check code style with Black | ||
run: | | ||
black . --check --diff | ||
test: | ||
name: Integration Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
path: "indy-tails-server" # Specify a path to clone the main repo into a specific directory | ||
|
||
# Clone von-network repository | ||
- name: Checkout von-network repository | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: "bcgov/von-network" | ||
path: "von-network" # Clone into a separate directory | ||
|
||
# Build and start von-network | ||
- name: Build and start von-network | ||
run: | | ||
cd von-network | ||
chmod +x manage | ||
./manage build | ||
./manage start | ||
- name: Build and run tests | ||
run: | | ||
cd indy-tails-server/docker | ||
chmod +x ./manage | ||
./manage build | ||
./manage test | ||
- name: Stop von-network | ||
run: | | ||
cd von-network | ||
./manage stop | ||
- name: Stop indy-tails-server | ||
run: | | ||
cd indy-tails-server/docker | ||
./manage stop |
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 |
---|---|---|
@@ -1,11 +1,27 @@ | ||
FROM bcgovimages/von-image:next-1 | ||
FROM ubuntu:20.04 | ||
|
||
# Note: libindy is a dependency for tests, and it's easiest to install on ubuntu images | ||
# using debian from python base images doesn't allow following steps to work, so build from ubuntu:20 | ||
|
||
# Install ca-certificates and add the Sovrin repository key | ||
RUN apt-get update && apt-get install -y ca-certificates gnupg software-properties-common && \ | ||
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys CE7709D068DB5E88 && \ | ||
add-apt-repository "deb https://repo.sovrin.org/sdk/deb bionic stable" && \ | ||
apt-get update && \ | ||
apt-get install -y libindy | ||
|
||
# Install Python 3.9 and python3-pip | ||
RUN apt-get install -y python3.9 python3.9-venv python3.9-dev python3-pip | ||
|
||
ADD requirements.txt . | ||
ADD requirements.dev.txt . | ||
|
||
RUN pip3 install --upgrade pip | ||
RUN pip3 install --no-cache-dir -r requirements.txt -r requirements.dev.txt | ||
# Upgrade pip using Python 3.9 to ensure compatibility | ||
RUN python3.9 -m pip install --upgrade pip | ||
|
||
# Use Python 3.9's pip to install dependencies from requirements files | ||
RUN python3.9 -m pip install --no-cache-dir -r requirements.txt -r requirements.dev.txt | ||
|
||
ADD test ./ | ||
|
||
ENTRYPOINT ["python", "integration.py"] | ||
ENTRYPOINT ["python3.9", "integration.py"] |
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 |
---|---|---|
@@ -1,5 +1,8 @@ | ||
rich | ||
pynacl | ||
aiofiles | ||
rich~=13.7.0 | ||
pynacl~=1.5.0 | ||
aiofiles~=23.2.1 | ||
|
||
python3_indy | ||
python3_indy~=1.16.0.post286 | ||
|
||
isort~=5.13.2 | ||
black~=24.2.0 |
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
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
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 |
---|---|---|
|
@@ -2,7 +2,6 @@ | |
|
||
import argparse | ||
|
||
|
||
PARSER = argparse.ArgumentParser(description="Runs the server.") | ||
|
||
|
||
|
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
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
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
Oops, something went wrong.