diff options
Diffstat (limited to 'src/content/docs/appendix/setup-dev-env.md')
| -rw-r--r-- | src/content/docs/appendix/setup-dev-env.md | 94 | 
1 files changed, 46 insertions, 48 deletions
| diff --git a/src/content/docs/appendix/setup-dev-env.md b/src/content/docs/appendix/setup-dev-env.md index c5ca5fa..9e7e080 100644 --- a/src/content/docs/appendix/setup-dev-env.md +++ b/src/content/docs/appendix/setup-dev-env.md @@ -5,23 +5,47 @@ sidebar:  ---  Creating a local development environment that mirrors the GitHub Actions -workflow ensures consistency between local development and continuous -integration builds. This guide leverages the steps defined in our GitHub Actions -workflow to help you set up a similar environment on your local machine. By -following these steps, you'll be able to compile, build, and test the project in -an environment closely resembling our CI pipeline, minimizing integration -issues. The exact commands and environment configurations used during the -compilation are documented within the project's `.github/workflow/release.yml` -file. +workflow is essential for maintaining consistency between local development and +continuous integration (CI) builds. This guide outlines the steps necessary to +configure your local machine in a way that aligns with the CI pipeline, ensuring +that the compilation, build, and testing processes are consistent across +environments. This approach minimizes integration issues and allows for smoother +development workflows. -## Prerequisites +## Leveraging GitHub Codespaces for Rapid Environment Setup + +To simplify and expedite the setup of a consistent development environment, we +recommend using GitHub Codespaces. Codespaces offers a cloud-hosted, +containerized development environment that matches the configurations used in +your GitHub Actions workflows. This enables you to quickly create an environment +that mirrors your CI pipeline, reducing the overhead of manual environment +configuration. + +### Quick Start with GitHub Codespaces + +[](https://codespaces.new/saturneric/GpgFrontend) + +With just one click, you can quickly launch a fully configured development +environment in GitHub Codespaces. + +### Manual Setup with GitHub Codespaces + +1. Navigate to your GitHub repository. +2. Click on the Code button and select Open with Codespaces. +3. If you haven't set up a Codespace for this repository, create a new one by +   following the prompts. GitHub will automatically configure a development +   environment based on the repository’s settings, including any configurations +   specified in the .devcontainer folder. +4. The Codespace environment will include all necessary dependencies and tools, +   ensuring consistency with the CI environment. + +## Manual Local Environment Setup (If not using Codespaces) + +### Prerequisites  - **Git:** Installed and configured on your system.  - **Compilers:** GCC and Clang for cross-compatibility. -- **CMake:** For generating build files. -- **Qt6:** If working on a project that utilizes Qt for its GUI. - -## Environment Setup Steps  ### Clone the Repository @@ -51,17 +75,17 @@ git config --global core.eol lf  ### Install Dependencies -- **On Ubuntu 20.04:** +- **On Ubuntu 20.04 or later:**  ```bash  sudo apt-get update -sudo apt-get install -y build-essential binutils git autoconf automake gettext texinfo gcc g++ ninja-build libarchive-dev libssl-dev libgpgme-dev +sudo apt-get install -y build-essential cmake ninja-build libarchive-dev libssl-dev libgpgme-dev  ```  - **On macOS (11 and 12):**  ```bash -brew install cmake autoconf automake texinfo gettext openssl@3 ninja libarchive gpgme +brew install cmake openssl@3 ninja libarchive gpgme  brew link --force openssl@3  ``` @@ -71,7 +95,7 @@ brew link --force openssl@3  ```bash  pacman -Syu -pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-make mingw-w64-x86_64-cmake autoconf automake make texinfo mingw-w64-x86_64-qt6 libintl msys2-runtime-devel gettext-devel mingw-w64-x86_64-ninja mingw-w64-x86_64-gnupg mingw-w64-x86_64-libarchive +pacman -S mingw-w64-x86_64-cmake msys2-runtime-devel mingw-w64-x86_64-ninja mingw-w64-x86_64-gnupg mingw-w64-x86_64-libarchive mingw-w64-x86_64-gpgme  ```  ### Install Qt6 (if applicable) @@ -79,44 +103,18 @@ pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-make mingw-w64-x86_64-cmake auto  Use the Qt online installer or your package manager to install Qt6 and the  required modules for your project. -### Build Third-Party Libraries (if needed) - -Follow the project's documentation to clone and build necessary third-party -libraries such as `libgpg-error`, `libassuan`, and `GpgME`. Use the same -commands as specified in the GitHub Actions workflow, adapted for your local -environment. - -### Configure and Build the Project - -- **For Linux and macOS:** +## Configure and Build the Project  ```bash -mkdir build && cd build -cmake .. -DCMAKE_BUILD_TYPE=Release -make -j$(nproc) +$ mkdir build && cd build +$ cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug .. +$ ninja  ``` -- **For Windows (via MSYS2):** - -```bash -mkdir build && cd build -cmake .. -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -mingw32-make -j$(nproc) -``` - -### Running Tests - -After building, run the project's tests to verify everything is working as -expected. - -## Notes +### Notes  - Adjust the build type (`Release`, `Debug`, etc.) as needed.  - Replace project-specific commands and dependency installation commands based    on your project's requirements.  - For macOS, additional steps for code signing and notarization are required only    for distribution. - -By closely following the GitHub Actions workflow for local setup, you're -creating a development environment that minimizes surprises during the -integration and deployment phases. | 
