Updating Continuous-Integration.md (#13161)

pull/13137/head
Michael Gene Brockus (Dreamer) 9 months ago committed by GitHub
parent bd149f8bca
commit f38a8269f8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 244
      docs/markdown/Continuous-Integration.md

@ -40,7 +40,7 @@ script:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then SDKROOT=$(xcodebuild -version -sdk macosx Path) meson setup builddir && meson test -C builddir; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then SDKROOT=$(xcodebuild -version -sdk macosx Path) meson setup builddir && meson test -C builddir; fi
``` ```
## CircleCi for Linux (with Docker) ## CircleCI for Linux host (with custom Docker images)
[CircleCi](https://circleci.com/) can work for spinning all of the [CircleCi](https://circleci.com/) can work for spinning all of the
Linux images you wish. Here's a sample `yml` file for use with that. Linux images you wish. Here's a sample `yml` file for use with that.
@ -68,25 +68,43 @@ jobs:
executor: meson_ubuntu_builder executor: meson_ubuntu_builder
steps: steps:
- checkout - checkout
- run: meson setup builddir --backend ninja - run:
- run: meson compile -C builddir name: Configure Project
- run: meson test -C builddir command: meson setup builddir --backend ninja
- run:
name: Compile Project
command: meson compile -C builddir
- run:
name: Run Tests
command: meson test -C builddir
meson_debian_build: meson_debian_build:
executor: meson_debian_builder executor: meson_debian_builder
steps: steps:
- checkout - checkout
- run: meson setup builddir --backend ninja - run:
- run: meson compile -C builddir name: Configure Project
- run: meson test -C builddir command: meson setup builddir --backend ninja
- run:
name: Compile Project
command: meson compile -C builddir
- run:
name: Run Tests
command: meson test -C builddir
meson_fedora_build: meson_fedora_build:
executor: meson_fedora_builder executor: meson_fedora_builder
steps: steps:
- checkout - checkout
- run: meson setup builddir --backend ninja - run:
- run: meson compile -C builddir name: Configure Project
- run: meson test -C builddir command: meson setup builddir --backend ninja
- run:
name: Compile Project
command: meson compile -C builddir
- run:
name: Run Tests
command: meson test -C builddir
workflows: workflows:
version: 2 version: 2
@ -95,6 +113,71 @@ workflows:
- meson_ubuntu_build - meson_ubuntu_build
- meson_debian_build - meson_debian_build
- meson_fedora_build - meson_fedora_build
```
## CircleCI for Linux host (without custom Docker images)
This CircleCI configuration defines two jobs, `build-linux` and `build-macos`,
within a workflow named `build`. The `build-linux` job utilizes a Docker image
with Python 3.12.3, while `build-macos` runs on macOS with Xcode 15.3.0. Each
job involves checking out the code, installing Meson and Ninja, configuring the
project, compiling it, and running tests using Meson.
```yaml
version: 2.1
jobs:
build-linux:
docker:
- image: cimg/python:3.12.3
steps:
- checkout
- run:
name: Install Meson and Ninja
command: |
python -m pip install --user meson ninja
- run:
name: Configure Project
command: |
meson setup builddir
- run:
name: Compile Project
command: |
meson compile -C builddir
- run:
name: Run Tests
command: |
meson test -C builddir
build-macos:
macos:
xcode: 15.3.0
steps:
- checkout
- run:
name: Install Meson and Ninja
command: |
python -m pip install meson ninja
- run:
name: Configure Project
command: |
meson setup builddir
- run:
name: Compile Project
command: |
meson compile -C builddir
- run:
name: Run Tests
command: |
meson test -C builddir
workflows:
version: 2.1
build:
jobs:
- build-linux
- build-macos
``` ```
## AppVeyor for Windows ## AppVeyor for Windows
@ -106,45 +189,25 @@ AppVeyor also has
[MacOS](https://www.appveyor.com/docs/macos-images-software/) and [MacOS](https://www.appveyor.com/docs/macos-images-software/) and
[Linux](https://www.appveyor.com/docs/linux-images-software/) CI [Linux](https://www.appveyor.com/docs/linux-images-software/) CI
images. This is a sample `appveyor.yml` file for Windows with Visual images. This is a sample `appveyor.yml` file for Windows with Visual
Studio 2015 and 2017. Studio 2017, 2019, and 2022.
```yaml ```yaml
image: Visual Studio 2017 version: 1.0.{build}
image:
environment: - Visual Studio 2022
matrix: - Visual Studio 2019
- arch: x86 - Visual Studio 2017
compiler: msvc2015
- arch: x64
compiler: msvc2015
- arch: x86
compiler: msvc2017
- arch: x64
compiler: msvc2017
platform:
- x64
install: install:
# Set paths to dependencies (based on architecture) - cmd: python -m pip install meson ninja
- cmd: if %arch%==x86 (set PYTHON_ROOT=C:\python37) else (set PYTHON_ROOT=C:\python37-x64)
# Print out dependency paths
- cmd: echo Using Python at %PYTHON_ROOT%
# Add necessary paths to PATH variable
- cmd: set PATH=%cd%;%PYTHON_ROOT%;%PYTHON_ROOT%\Scripts;%PATH%
# Install meson and ninja
- cmd: pip install ninja meson
# Set up the build environment
- cmd: if %compiler%==msvc2015 ( call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %arch% )
- cmd: if %compiler%==msvc2017 ( call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" %arch% )
build_script: build_script:
- cmd: echo Building on %arch% with %compiler% - cmd: >-
- cmd: meson --backend=ninja builddir meson setup builddir
- cmd: meson compile -C builddir meson compile -C builddir
test_script: test_script:
- cmd: meson test -C builddir - cmd: meson test -C builddir
``` ```
### Qt ### Qt
@ -199,16 +262,17 @@ script:
## GitHub Actions ## GitHub Actions
GitHub Actions are distinct from Azure Pipelines in their workflow GitHub Actions provides a versatile platform for continuous integration
syntax. It can be easier to setup specific CI tasks in Actions than (CI). This example workflow file, `ci_meson.yml`, is tailored for C-based
Pipelines, depending on the particular task. This is an example file: projects utilizing GCC on Linux, macOS, and Windows. Triggered by changes
.github/workflows/ci_meson.yml supposing the project is C-based, using to C code files, it automates building and testing processes using different
GCC on Linux, Mac and Windows. The optional `on:` parameters only run versions of Meson (1.0.0, 1.1.0, 1.2.0, 1.3.0, 1.4.0) across various operating
this CI when the C code is changed--corresponding ci_python.yml might systems. Each job in the workflow handles checkout, dependency installation,
run only on "**.py" file changes. project configuration, test execution, and optional test log uploads upon
failure.
```yaml ```yaml
name: ci_meson name: CI Meson
on: on:
push: push:
@ -221,59 +285,33 @@ on:
- "**.h" - "**.h"
jobs: jobs:
build:
linux: name: Build and Test on ${{ matrix.os }} with Meson v${{ matrix.meson_version }}
runs-on: ubuntu-latest runs-on: ${{ matrix.os }}
steps: strategy:
- uses: actions/checkout@v1 matrix:
- uses: actions/setup-python@v1 os: [ubuntu-latest, macos-latest, windows-latest]
with: meson_version: ["1.2.0", "1.3.0", "1.4.0"]
python-version: '3.x'
- run: pip install meson ninja
- run: meson setup builddir/
env:
CC: gcc
- run: meson test -C builddir/ -v
- uses: actions/upload-artifact@v1
if: failure()
with:
name: Linux_Meson_Testlog
path: builddir/meson-logs/testlog.txt
macos:
runs-on: macos-latest
steps: steps:
- uses: actions/checkout@v1 - name: Checkout code
- uses: actions/setup-python@v1 uses: actions/checkout@v4
with: - name: Set up Python
python-version: '3.x' uses: actions/setup-python@v5
- run: brew install gcc with:
- run: pip install meson ninja python-version: '3.x'
- run: meson setup builddir/ - name: Install dependencies
env: run: python -m pip install meson==${{ matrix.meson_version }} ninja
CC: gcc - name: Configure Project
- run: meson test -C builddir/ -v run: meson setup builddir/
- uses: actions/upload-artifact@v1 env:
if: failure() CC: gcc
with: - name: Run Tests
name: MacOS_Meson_Testlog run: meson test -C builddir/ -v
path: builddir/meson-logs/testlog.txt - name: Upload Test Log
uses: actions/upload-artifact@v4
windows: if: failure()
runs-on: windows-latest with:
steps: name: ${{ matrix.os }}_Meson_Testlog
- uses: actions/checkout@v1 path: builddir/meson-logs/testlog.txt
- uses: actions/setup-python@v1
with:
python-version: '3.x'
- run: pip install meson ninja
- run: meson setup builddir/
env:
CC: gcc
- run: meson test -C builddir/ -v
- uses: actions/upload-artifact@v1
if: failure()
with:
name: Windows_Meson_Testlog
path: builddir/meson-logs/testlog.txt
``` ```

Loading…
Cancel
Save