From 04c8fc8264310c63314f54ad5dee5bd727871c5c Mon Sep 17 00:00:00 2001 From: "@RandyMcMillan" Date: Tue, 20 Dec 2022 18:03:05 -0500 Subject: [PATCH] workflow: add ubuntu matrix [ubuntu-22.04, ubuntu-latest] add better test sequence --- .github/workflows/c-cpp.yml | 54 +++++++++++++++++++++++++++++-------- 1 file changed, 43 insertions(+), 11 deletions(-) diff --git a/.github/workflows/c-cpp.yml b/.github/workflows/c-cpp.yml index b42baf7..0532916 100644 --- a/.github/workflows/c-cpp.yml +++ b/.github/workflows/c-cpp.yml @@ -1,17 +1,49 @@ -name: C/C++ CI +name: nostril-ubuntu-matrix +# Controls when the action will run. on: - push: - branches: [ "master", "**" ] pull_request: - branches: [ "master" ] + branches: + - '*' + - '*/*' + - '**' + - 'master' + - 'main' + push: + branches: + - '*' + - '*/*' + - '**' + - 'master' + - 'main' + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - build: - - runs-on: ubuntu-latest - + ubuntu-build_and_test: + strategy: + matrix: + os: [ubuntu-20.04, ubuntu-latest] + runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 - - name: make - run: make + - uses: styfle/cancel-workflow-action@0.9.1 + with: + access_token: ${{ github.token }} + - uses: actions/checkout@v2 + - name: printenv + run: | + printenv + - name: make + run: | + make + - name: sudo make install + run: | + sudo make install + - name: man nostril + run: | + man nostril + - name: sudo -su runner nostril + run: | + #pipe handles non-zero return from nostril default help + sudo -su runner nostril | echo "${PIPESTATUS[0]}"