Skip to content

Bump actions/upload-artifact from 3.1.3 to 4.3.0 #6

Bump actions/upload-artifact from 3.1.3 to 4.3.0

Bump actions/upload-artifact from 3.1.3 to 4.3.0 #6

Workflow file for this run

name: Test
on:
workflow_dispatch:
pull_request:
push:
branches: [main]
jobs:
distribute:
runs-on: ubuntu-latest
steps:
- name: Checkout this repository
uses: actions/[email protected]
- name: Cache dependencies
id: cache-npm
uses: actions/[email protected]
with:
path: node_modules
key: node-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
if: steps.cache-npm.outputs.cache-hit != 'true'
run: npm install
- name: Run formatter
run: npm run format
- name: Run static analysis
run: npm run lint
- name: Upload this project as an artifact
uses: actions/[email protected]
with:
name: project
path: |
*
!node_modules/
check-distribution:
needs: distribute
runs-on: ubuntu-latest
steps:
- name: Download the project artifact
uses: actions/[email protected]
with:
name: project
- name: Check if the distribution is up to date
run: git diff --exit-code HEAD
unit-tests:
needs: distribute
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os: [windows, ubuntu, macos]
steps:
- name: Download the project artifact
uses: actions/[email protected]
with:
name: project
- name: Cache dependencies
id: cache-npm
uses: actions/[email protected]
with:
path: node_modules
key: node-${{ runner.os }}-${{ hashFiles('package-lock.json') }}
- name: Install dependencies
if: steps.cache-npm.outputs.cache-hit != 'true'
run: npm install
- name: Run unit tests
run: npm test
standard-usage:
needs: unit-tests
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os: [windows, ubuntu, macos]
steps:
- name: Download the project artifact
uses: actions/[email protected]
with:
name: project
- name: Configure, build, and test the sample project
uses: threeal/[email protected]
with:
source-dir: sample
generator: Ninja
cxx-compiler: g++
run-test: true
- name: Upload this project as an artifact
uses: actions/[email protected]
with:
name: project-with-build-${{ matrix.os }}
path: |
*
!lib/
!node_modules/
- name: Use this action
uses: ./
llvm-usage:
needs: unit-tests
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os: [windows, ubuntu, macos]
steps:
- name: Download the project artifact
uses: actions/[email protected]
with:
name: project
- name: Configure, build, and test the sample project
uses: threeal/[email protected]
with:
source-dir: sample
generator: Ninja
c-compiler: clang
cxx-compiler: clang++
run-test: true
- name: Use this action with llvm-cov as the gcov executable
uses: ./
with:
gcov-executable: ${{ matrix.os == 'macos' && 'xcrun ' || '' }}llvm-cov gcov
exclusion-usage:
needs: unit-tests
runs-on: ${{ matrix.os }}-latest
strategy:
fail-fast: false
matrix:
os: [windows, ubuntu, macos]
steps:
- name: Download the project artifact
uses: actions/[email protected]
with:
name: project
- name: Configure, build, and test the sample project
uses: threeal/[email protected]
with:
source-dir: sample
generator: Ninja
cxx-compiler: g++
args: -DTEST_EVEN=OFF -DTEST_ODD=OFF
run-test: true
- name: Use this action without an exclusion
id: failed_step
continue-on-error: true
uses: ./
with:
root: sample
fail-under-line: 100
- name: Check if the previous step did fail
run: ${{ steps.failed_step.outcome == 'failure' && true || false }}
- name: Use this action without an exclusion but with a lower fail threshold
uses: ./
with:
root: sample
fail-under-line: 50
- name: Use this action with an exclusion
uses: ./
with:
root: sample
excludes: sample/include/*
fail-under-line: 100
- name: Use this action with multiple exclusions
uses: ./
with:
root: sample
excludes: |
sample/include/is_even.hpp
sample/include/is_odd.hpp
fail-under-line: 100
xml-out-usage:
needs: standard-usage
runs-on: ubuntu-latest
steps:
- name: Download the project artifact
uses: actions/[email protected]
with:
name: project-with-build-ubuntu
- name: Use this action to generate an XML report
uses: ./
with:
xml-out: coverage.xml
- name: Check if that XML report does exist
run: cat coverage.xml
coveralls-usage:
needs: standard-usage
runs-on: ubuntu-latest
steps:
- name: Download the project artifact
uses: actions/[email protected]
with:
name: project-with-build-ubuntu
- name: Use this action to generate a Coveralls report
uses: ./
with:
coveralls-out: coveralls.json
- name: Check if that Coveralls report does exist
run: cat coveralls.json
- name: Use this action to generate and send another Coveralls report
uses: ./
with:
coveralls-send: true
github-token: ${{ secrets.GITHUB_TOKEN }}