mirror of
https://github.com/johndoe6345789/GithubWorkflowTool.git
synced 2026-04-30 08:35:20 +00:00
Add documentation, examples, and fix missing includes
Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
This commit is contained in:
72
examples/example-workflow.yml
Normal file
72
examples/example-workflow.yml
Normal file
@@ -0,0 +1,72 @@
|
||||
name: Example CI Workflow
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, develop ]
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
BUILD_TYPE: Release
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build and Test
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup build environment
|
||||
run: |
|
||||
echo "Setting up build environment"
|
||||
sudo apt-get update
|
||||
|
||||
- name: Configure
|
||||
run: |
|
||||
echo "Configuring project"
|
||||
cmake -B build -G Ninja
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
echo "Building project"
|
||||
cmake --build build
|
||||
|
||||
- name: Test
|
||||
run: |
|
||||
echo "Running tests"
|
||||
cd build && ctest
|
||||
|
||||
- name: Upload artifacts
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: build-artifacts
|
||||
path: build/
|
||||
|
||||
test-matrix:
|
||||
name: Test Matrix
|
||||
runs-on: ubuntu-latest
|
||||
needs: build
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
compiler: [gcc, clang]
|
||||
build_type: [Debug, Release]
|
||||
|
||||
steps:
|
||||
- name: Test ${{ matrix.compiler }} - ${{ matrix.build_type }}
|
||||
run: |
|
||||
echo "Testing with ${{ matrix.compiler }} in ${{ matrix.build_type }} mode"
|
||||
|
||||
deploy:
|
||||
name: Deploy
|
||||
runs-on: ubuntu-latest
|
||||
needs: [build, test-matrix]
|
||||
if: github.ref == 'refs/heads/main'
|
||||
|
||||
steps:
|
||||
- name: Deploy application
|
||||
run: |
|
||||
echo "Deploying application"
|
||||
Reference in New Issue
Block a user