|
3 | 3 | workflow_dispatch: |
4 | 4 | push: |
5 | 5 | jobs: |
6 | | - use-action: |
7 | | - runs-on: ubuntu-latest |
| 6 | + standard-usage: |
| 7 | + runs-on: ${{ matrix.os }}-latest |
| 8 | + strategy: |
| 9 | + fail-fast: false |
| 10 | + matrix: |
| 11 | + os: [windows, ubuntu, macos] |
8 | 12 | steps: |
9 | | - - name: Checkout repository |
10 | | - uses: actions/checkout@v3.2.0 |
| 13 | + - name: Checkout this repository |
| 14 | + uses: actions/checkout@v3.3.0 |
11 | 15 |
|
12 | | - - name: Build and test example project |
13 | | - run: | |
14 | | - cmake test -B build |
15 | | - cmake --build build |
16 | | - ctest --test-dir build |
17 | | -
|
18 | | - - name: Use this action |
19 | | - uses: ./ |
20 | | - |
21 | | - use-action-llvm: |
22 | | - runs-on: ubuntu-latest |
23 | | - steps: |
24 | | - - name: Checkout repository |
25 | | - |
26 | | - |
27 | | - - name: Install LLVM |
28 | | - run: sudo apt install -y llvm |
| 16 | + - name: Configure and build the test project |
| 17 | + |
| 18 | + with: |
| 19 | + source-dir: test |
| 20 | + generator: Ninja |
| 21 | + cxx-compiler: g++ |
29 | 22 |
|
30 | | - - name: Build and test example project |
31 | | - run: | |
32 | | - cmake test -B build -DCMAKE_CXX_COMPILER=clang++ |
33 | | - cmake --build build |
34 | | - ctest --test-dir build |
| 23 | + - name: Test the test project |
| 24 | + run: ctest --test-dir build |
35 | 25 |
|
36 | 26 | - name: Use this action |
37 | 27 | uses: ./ |
38 | | - with: |
39 | | - gcov-executable: llvm-cov gcov |
40 | 28 |
|
41 | | - use-action-from-different-root: |
42 | | - runs-on: ubuntu-latest |
| 29 | + llvm-usage: |
| 30 | + runs-on: ${{ matrix.os }}-latest |
| 31 | + strategy: |
| 32 | + fail-fast: false |
| 33 | + matrix: |
| 34 | + os: [windows, ubuntu, macos] |
43 | 35 | steps: |
44 | | - - name: Checkout repository |
45 | | - |
46 | | - |
47 | | - - name: Build and test example project |
48 | | - working-directory: test |
49 | | - run: | |
50 | | - cmake . -B build |
51 | | - cmake --build build |
52 | | - ctest --test-dir build |
| 36 | + - name: Checkout this repository |
| 37 | + |
53 | 38 |
|
54 | | - - name: Use this action from build root |
55 | | - id: failed_step |
56 | | - continue-on-error: true |
57 | | - uses: ./ |
| 39 | + - name: Configure and build the test project |
| 40 | + |
58 | 41 | with: |
59 | | - root: test/build |
60 | | - fail-under-line: 100 |
| 42 | + source-dir: test |
| 43 | + generator: Ninja |
| 44 | + c-compiler: clang |
| 45 | + cxx-compiler: clang++ |
61 | 46 |
|
62 | | - - name: Check if previous step is failing |
63 | | - run: ${{ steps.failed_step.outcome == 'failure' && true || false }} |
| 47 | + - name: Test the test project |
| 48 | + run: ctest --test-dir build |
64 | 49 |
|
65 | | - - name: Use this action from build root but without fail threshold |
| 50 | + - name: Use this action with llvm-cov as the gcov executable |
66 | 51 | uses: ./ |
67 | 52 | with: |
68 | | - root: test/build |
| 53 | + gcov-executable: ${{ matrix.os == 'macos' && 'xcrun ' || '' }}llvm-cov gcov |
| 54 | + |
| 55 | + exclusion-usage: |
| 56 | + runs-on: ${{ matrix.os }}-latest |
| 57 | + strategy: |
| 58 | + fail-fast: false |
| 59 | + matrix: |
| 60 | + os: [windows, ubuntu, macos] |
| 61 | + steps: |
| 62 | + - name: Checkout this repository |
| 63 | + |
69 | 64 |
|
70 | | - - name: Use this action from project root |
71 | | - uses: ./ |
| 65 | + - name: Configure and build the test project |
| 66 | + |
72 | 67 | with: |
73 | | - root: test |
74 | | - fail-under-line: 100 |
75 | | - |
76 | | - use-action-with-exclusion: |
77 | | - runs-on: ubuntu-latest |
78 | | - steps: |
79 | | - - name: Checkout repository |
80 | | - |
| 68 | + source-dir: test |
| 69 | + build-dir: test/build |
| 70 | + generator: Ninja |
| 71 | + cxx-compiler: g++ |
| 72 | + args: -DTEST_EVEN=OFF -DTEST_ODD=OFF |
81 | 73 |
|
82 | | - - name: Build and test example project |
83 | | - working-directory: test |
84 | | - run: | |
85 | | - cmake . -B build -DTEST_EVEN=OFF -DTEST_ODD=OFF |
86 | | - cmake --build build |
87 | | - ctest --test-dir build |
| 74 | + - name: Test the test project |
| 75 | + run: ctest --test-dir test/build |
88 | 76 |
|
89 | | - - name: Use this action without exclusion |
| 77 | + - name: Use this action without an exclusion |
90 | 78 | id: failed_step |
91 | 79 | continue-on-error: true |
92 | 80 | uses: ./ |
93 | 81 | with: |
| 82 | + root: test |
94 | 83 | fail-under-line: 100 |
95 | 84 |
|
96 | | - - name: Check if previous step is failing |
| 85 | + - name: Check if the previous step did fail |
97 | 86 | run: ${{ steps.failed_step.outcome == 'failure' && true || false }} |
98 | 87 |
|
99 | | - - name: Use this action without exclusion but with lower fail threshold |
| 88 | + - name: Use this action without an exclusion but with a lower fail threshold |
100 | 89 | uses: ./ |
101 | 90 | with: |
| 91 | + root: test |
102 | 92 | fail-under-line: 50 |
103 | 93 |
|
104 | | - - name: Use this action with exclusion |
| 94 | + - name: Use this action with an exclusion |
105 | 95 | uses: ./ |
106 | 96 | with: |
| 97 | + root: test |
107 | 98 | exclude: test/include/* |
108 | 99 | fail-under-line: 100 |
109 | 100 |
|
110 | | - use-action-generate-coveralls: |
111 | | - runs-on: ubuntu-latest |
| 101 | + coveralls-usage: |
| 102 | + runs-on: ${{ matrix.os }}-latest |
| 103 | + strategy: |
| 104 | + fail-fast: false |
| 105 | + matrix: |
| 106 | + os: [windows, ubuntu, macos] |
112 | 107 | steps: |
113 | | - - name: Checkout repository |
114 | | - |
| 108 | + - name: Checkout this repository |
| 109 | + |
| 110 | + |
| 111 | + - name: Configure and build the test project |
| 112 | + |
| 113 | + with: |
| 114 | + source-dir: test |
| 115 | + generator: Ninja |
| 116 | + cxx-compiler: g++ |
115 | 117 |
|
116 | | - - name: Build and test example project |
117 | | - run: | |
118 | | - cmake test -B build |
119 | | - cmake --build build |
120 | | - ctest --test-dir build |
| 118 | + - name: Test the test project |
| 119 | + run: ctest --test-dir build |
121 | 120 |
|
122 | | - - name: Use this action to generate Coveralls report |
| 121 | + - name: Use this action to generate a Coveralls report |
123 | 122 | uses: ./ |
124 | 123 | with: |
125 | 124 | coveralls-out: coveralls.json |
126 | 125 |
|
127 | | - - name: Check if Coveralls report exist |
| 126 | + - name: Check if that Coveralls report does exist |
128 | 127 | run: cat coveralls.json |
129 | 128 |
|
130 | | - - name: Use this action to generate and send Coveralls report |
| 129 | + - name: Use this action to generate and send another Coveralls report |
131 | 130 | uses: ./ |
132 | 131 | with: |
133 | 132 | coveralls-send: true |
134 | | - coveralls-repo-token: ${{ secrets.COVERALLS_REPO_TOKEN }} |
| 133 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
135 | 134 |
|
136 | | - - name: Use this action to generate and send Coveralls report on specified output |
| 135 | + - name: Use this action to generate and send another Coveralls report on a specified output |
137 | 136 | uses: ./ |
138 | 137 | with: |
139 | 138 | coveralls-out: coveralls-2.json |
140 | 139 | coveralls-send: true |
141 | | - coveralls-repo-token: ${{ secrets.COVERALLS_REPO_TOKEN }} |
| 140 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
142 | 141 |
|
143 | | - - name: Check if Coveralls report exist |
| 142 | + - name: Check if that Coveralls report does exist |
144 | 143 | run: cat coveralls-2.json |
0 commit comments