Skip to content

Commit

Permalink
Add CI to vectorizing CU-86bvyavpu (#46)
Browse files Browse the repository at this point in the history
* Add CI pipeline to run tests with gha
* Add system dependencies installer script shared between dev container and CI
* Update README documentation
* Remove 'python-dev0 as system dependency
  • Loading branch information
pietrobolcato authored Sep 21, 2023
1 parent 9a69776 commit 93e4675
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 3 deletions.
8 changes: 6 additions & 2 deletions .devcontainer/scripts/post_create.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#!/bin/bash
# this script install system dependencies for vectorizing and sets up conda

sudo apt-get update
sudo apt-get install -y build-essential python-dev libagg-dev libpotrace-dev pkg-config libffi-dev libcairo2-dev
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )

# install system dependencies
bash "$SCRIPT_DIR"/../../scripts/install_system_dependencies.sh

# setup conda
conda env create -n dev -f envs/dev.yaml
conda init
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: ci
on: [push, pull_request]

jobs:
ci:
name: CI
runs-on: ubuntu-latest
env:
PORT: "8000"
S3_BUCKET: "-"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
S3_TEST_BUCKET: ${{ secrets.S3_TEST_BUCKET }}
steps:
- name: Check out repository code
uses: actions/checkout@v2
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-central-1
- name: Set up Python 3.11
uses: actions/setup-python@v2
with:
python-version: 3.11
- name: Set up system dependencies
run: |
bash scripts/install_system_dependencies.sh
- name: Set up `dev` conda environment
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: dev
environment-file: envs/dev.yaml
auto-activate-base: false
- name: Run tests
shell: bash -el {0}
run: |
conda activate dev
python -m pytest vectorizing/tests/test.py
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ The first time the execution can take few minutes, as it is pulling the dev cont
bash scripts/compile_envs.sh
```

This will compile dependencies and environments, ensuring a consistent development workflow and deployment.
This will compile dependencies and environments, ensuring a consistent development workflow and deployment.

4. If you want to add or remove **system** dependencies, update the script: [`scripts/install_system_dependencies.sh`](scripts/install_system_dependencies.sh). This is used both in CI and at dev container creation, to keep them consistent.

## Server

Expand Down
5 changes: 5 additions & 0 deletions scripts/install_system_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
# this script install system dependencies for vectorizing

sudo apt-get update
sudo apt-get install -y build-essential libagg-dev libpotrace-dev pkg-config libffi-dev libcairo2-dev

0 comments on commit 93e4675

Please sign in to comment.