Bump actions/download-artifact from 3.0.2 to 4.1.1 #13
Workflow file for this run
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: Test | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: [main] | |
jobs: | |
check-package: | |
name: Check Package | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
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: Check Format | |
run: | | |
npm run format | |
git diff --exit-code HEAD | |
- name: Check Lint | |
run: npm run lint | |
unit-tests: | |
runs-on: ${{ matrix.os }}-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows, ubuntu, macos] | |
steps: | |
- name: Checkout | |
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 unit tests | |
run: npm test | |
standard-usage: | |
runs-on: ${{ matrix.os }}-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows, ubuntu, macos] | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- 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: | |
runs-on: ${{ matrix.os }}-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows, ubuntu, macos] | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- 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: | |
runs-on: ${{ matrix.os }}-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [windows, ubuntu, macos] | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- 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 }} |