Skip to content

simplify git user/email in CI #51

simplify git user/email in CI

simplify git user/email in CI #51

Workflow file for this run

name: C++/make CI
on:
push:
branches: [ main ]
tags: [ '*' ]
pull_request:
branches: [ main ]
jobs:
check:
name: Check code
runs-on: macos-latest
timeout-minutes: 5
steps:
- name: install deps
run: |
brew update
brew install --force-bottle bear llvm
env:
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: yes
HOMEBREW_NO_ENV_HINTS: yes
HOMEBREW_NO_ANALYTICS: yes
- uses: actions/checkout@v4
with:
repository: getargv/getargv
path: getargv
token: ${{ secrets.GH_PAT }}
- name: Build libgetargv
run: make dylib
working-directory: getargv
- name: Install libgetargv
run: sudo make install_dylib
working-directory: getargv
- uses: actions/checkout@v4
with:
path: getargv.cpp
- name: check
run: "make LIBVER=$(sw_vers -ProductVersion) lint"
working-directory: getargv.cpp
test:
name: Test on ${{ matrix.os }}
timeout-minutes: 10
strategy:
matrix:
os:
#- macos-15 not out yet
- macos-14
- macos-13
- macos-12
runs-on: ${{ matrix.os }}
steps:
- name: install deps
run: |
brew update
brew install --force-bottle criterion
env:
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: yes
HOMEBREW_NO_ENV_HINTS: yes
HOMEBREW_NO_ANALYTICS: yes
- uses: actions/checkout@v4
with:
repository: getargv/getargv
path: getargv
token: ${{ secrets.GH_PAT }}
- name: Build libgetargv
run: make dylib
working-directory: getargv
- name: Install libgetargv
run: sudo make install_dylib
working-directory: getargv
- uses: actions/checkout@v4
with:
path: getargv.cpp
- name: build unit tests
run: make lib_unit_tests
working-directory: getargv.cpp/test
- name: build libtests
run: make libtest1 libtest2
working-directory: getargv.cpp/test
- name: run tests with coverage
run: make run_lib_unit_tests_coverage
timeout-minutes: 5
working-directory: getargv.cpp/test
build:
name: Build on ${{ matrix.os }}
timeout-minutes: 5
needs: [ check, test ]
strategy:
matrix:
os:
- macos-14
- macos-13
- macos-12
#- macos-11
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
repository: getargv/getargv
path: getargv
token: ${{ secrets.GH_PAT }}
- name: Build libgetargv
run: make dylib
working-directory: getargv
- name: Install libgetargv
run: sudo make install_dylib
working-directory: getargv
- uses: actions/checkout@v4
with:
path: getargv.cpp
- name: bump version
run: make bump
working-directory: getargv.cpp
- name: make library
run: make dylib
working-directory: getargv.cpp
- name: make installer
run: make dmg
working-directory: getargv.cpp
- name: rename dmg
run: mv pkg/*.dmg pkg/libgetargv++-${{ matrix.os }}.dmg
working-directory: getargv.cpp
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}.zip
path: |
getargv.cpp/pkg/*.pkg
getargv.cpp/pkg/*.dmg
release:
needs: [ build ]
permissions:
contents: write
runs-on: ubuntu-latest
env:
GIT_AUTHOR_NAME: github-actions
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_NAME: github-actions
GIT_COMMITTER_EMAIL: [email protected]
MACOS_VER_NUM: 14.0
CERT_IDENTITY: me
LDLIBS: -lgetargv
CXXFLAGS: -Iinclude
steps:
- uses: actions/checkout@v4
with:
path: getargv.cpp
- uses: actions/download-artifact@v4
with:
path: pkg
- name: bump version
id: version
run: echo "version=$(make bump)" >> $GITHUB_OUTPUT
working-directory: getargv.cpp
# do not merge these steps, version is scraped by makefile
# at start of run, so needs to be bumped separately
- name: tag & commit
run: make tag
working-directory: getargv.cpp
- name: Release
uses: softprops/action-gh-release@v2
with:
files: pkg/*.zip/*.dmg
name: ${{ steps.version.outputs.version }}
tag_name: ${{ steps.version.outputs.version }}