Make C++ file io more idiomatic #117
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "C++" | |
on: | |
push: | |
paths: | |
- 'cplusplus/**' | |
- '!cplusplus/README.rst' | |
schedule: | |
- cron: "0 0 1 * *" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
cpp: | |
strategy: | |
fail-fast: false | |
matrix: | |
# compiler: ["llvm", "gcc"] | |
# # compiler targets (ideally): clang, gcc, MSVCC, icc, | |
os: [windows-latest, macos-latest, macos-13] | |
compiler: ['all'] | |
include: | |
- os: ubuntu-latest | |
compiler: clang | |
- os: ubuntu-latest | |
compiler: gcc | |
# - os: windows-latest | |
# compiler: msvc | |
# - os: windows-latest | |
# compiler: mingw | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Use Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
cache-dependency-path: '*/requirements.txt' | |
- name: Setup MSVC | |
uses: aminya/setup-cpp@v1 | |
if: ${{ contains(matrix.os, 'windows') }} | |
with: | |
compiler: msvc | |
vcvarsall: true | |
- name: Run tests (ubuntu-latest) | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
run: make cp_test COV=true COMPILER_OVERRIDE=${{ matrix.compiler }} NO_CLEANUP=true | |
# - name: Setup upterm session | |
# uses: lhotari/action-upterm@v1 | |
# if: ${{ matrix.os == 'ubuntu-latest' }} | |
# with: | |
# ## limits ssh access and adds the ssh public key for the user which triggered the workflow | |
# limit-access-to-actor: true | |
- name: Run tests (ubuntu lts) | |
if: ${{ contains(matrix.os, 'ubuntu') && matrix.os != 'ubuntu-latest' }} | |
run: make c_test_auto | |
- name: Run tests (windows) | |
if: ${{ contains(matrix.os, 'windows') }} | |
run: make cp_test_auto | |
- name: Run tests (macos) | |
if: ${{ contains(matrix.os, 'macos') }} | |
run: make cp_test_auto | |
env: | |
NO_OPTIONAL_TESTS: true | |
COMPILER_OVERRIDE: clang | |
- name: Upload coverage reports to Codecov | |
uses: codecov/[email protected] | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
flags: Cpp |