Skip to content

[WIP] Add build and test process for C++#1

Draft
Copilot wants to merge 6 commits intomainfrom
copilot/build-and-test-cpp
Draft

[WIP] Add build and test process for C++#1
Copilot wants to merge 6 commits intomainfrom
copilot/build-and-test-cpp

Conversation

Copy link
Copy Markdown

Copilot AI commented Nov 13, 2025

Modified GitHub Actions workflow to publish ProofOfSpace.exe to releases:

  • Understand the current build-test-cplusplus.yml workflow structure
  • Add artifact upload step to Windows build job to save ProofOfSpace.exe
  • Add new release job that creates a release with timestamp tag after Windows build succeeds
  • Upload ProofOfSpace.exe from Windows build to the created release
  • Ensure the release job only runs on push events to main or release branches (not on PRs)
  • Validate YAML syntax

Changes made:

  1. Added artifact upload step to the windows job to save ProofOfSpace.exe
  2. Created new release job that:
    • Depends on successful completion of windows job
    • Only runs on push events to main or release/* branches
    • Downloads the ProofOfSpace.exe artifact
    • Generates a timestamp-based tag (format: vYYYYMMDDHHMMSS)
    • Creates a GitHub release with the timestamp tag
    • Uploads ProofOfSpace.exe to the release
Original prompt

name: Build and Test C++

on:
push:
branches:
- main
release:
types: [published]
pull_request:
branches:
- "**"

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}--${{ (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/') || startsWith(github.ref, 'refs/heads/long_lived/')) && github.sha || '' }}
cancel-in-progress: true

jobs:
coverage:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Collect coverage data
run: |
sudo apt-get update
sudo apt-get install lcov -y
cmake -B ../build -DCMAKE_BUILD_TYPE=Debug -DWITH_COVERAGE=1
cmake --build ../build -- -j 6
../build/RunTests
lcov --directory ../build --capture --output-file lcov.info
lcov --remove lcov.info '_deps/' '/usr/*' --output-file lcov.info
- name: Upload to Coveralls
uses: coverallsapp/github-action@v2
if: always()
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
with:
path-to-lcov: "./lcov.info"
valgrind:
name: valgrind ubuntu
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v5

  - name: cmake, RunTests, and valgrind on ubuntu-20.04
    run: |
      sudo apt update
      sudo apt-get install valgrind -y
      mkdir build
      cd build
      cmake ../
      cmake --build . -- -j 6
      ctest -j 6 --output-on-failure
      valgrind --leak-check=full --show-leak-kinds=all --errors-for-leak-kinds=all ctest -j 6 --output-on-failure

asan:
name: ASAN ubuntu
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v5

  - name: cmake, RunTests with address- and undefined sanitizer on Ubuntu
    run: |
      mkdir build-asan
      cd build-asan
      cmake -DCMAKE_BUILD_TYPE=ASAN ../
      cmake --build . -- -j 6
      ./RunTests

tsan:
name: TSAN ubuntu
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v5

  # See: https://github.com/google/sanitizers/issues/1716
  # Fixes `FATAL: ThreadSanitizer: unexpected memory mapping 0x70498d8ae000-0x70498dd00000` type errors
  - name: Adjust mmap_rnd_bits on ubuntu
    run: |
      sudo sysctl vm.mmap_rnd_bits=28

  - name: cmake, RunTests with thread sanitizer on Ubuntu
    run: |
      mkdir build-tsan
      cd build-tsan
      cmake -DCMAKE_BUILD_TYPE=TSAN ../
      cmake --build . -- -j 6
      ./RunTests

mac:
name: MacOS
runs-on: macos-15-intel
steps:
- name: Checkout code
uses: actions/checkout@v5

  - name: cmake, RunTests on Mac
    run: |
      mkdir build
      cd build
      cmake ..
      cmake --build . --config Release -j 6
      ./RunTests

windows:
name: Windows Latest
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v5

  - name: cmake, RunTests with Windows
    run: |
      mkdir build-win
      cd build-win
      cmake ..
      cmake --build . --config Release -j 6
      ctest -C Release -j 6

帮我修改这个Action配置,让他将构建成功后的ProofOfSpace.exe发布到release,tag可以用当前时间戳。


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

liyifeng and others added 5 commits November 13, 2025 18:03
add action
Updated CI workflow to enhance clarity and functionality, including renaming job and improving descriptions for inputs. Adjusted build steps and artifact handling for better organization.
Co-authored-by: liyifeng <4817467+liyifeng@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants