|
| 1 | +name: Examples |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ main ] |
| 6 | + pull_request: |
| 7 | + branches: [ main ] |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +jobs: |
| 11 | + |
| 12 | + # This runs C tests using the Clar test framework |
| 13 | + c-clar: |
| 14 | + name: C / Clar |
| 15 | + runs-on: ubuntu-latest |
| 16 | + |
| 17 | + steps: |
| 18 | + - name: Check out repository |
| 19 | + uses: actions/checkout@v3 |
| 20 | + - name: Build and test |
| 21 | + run: | |
| 22 | + make |
| 23 | + ./test -rresults/tests.xml |
| 24 | + working-directory: c-clar |
| 25 | + - name: Create test summary |
| 26 | + uses: test-summary/action@dist |
| 27 | + with: |
| 28 | + paths: c-clar/results/**/*.xml |
| 29 | + output: c-clar/results/test-summary.md |
| 30 | + if: always() |
| 31 | + - name: Upload test summary |
| 32 | + uses: actions/upload-artifact@v3 |
| 33 | + with: |
| 34 | + name: c-clar |
| 35 | + path: c-clar/results/test-summary.md |
| 36 | + if: always() |
| 37 | + |
| 38 | + # This runs .NET tests using the standard .NET test driver |
| 39 | + dotnet: |
| 40 | + name: .NET |
| 41 | + runs-on: ubuntu-latest |
| 42 | + |
| 43 | + steps: |
| 44 | + - name: Check out repository |
| 45 | + uses: actions/checkout@v3 |
| 46 | + - name: Build and test |
| 47 | + run: | |
| 48 | + dotnet build |
| 49 | + dotnet test --logger "junit;LogFilePath=results/tests.xml" |
| 50 | + working-directory: dotnet |
| 51 | + - name: Create test summary |
| 52 | + uses: test-summary/action@dist |
| 53 | + with: |
| 54 | + paths: dotnet/results/**/*.xml |
| 55 | + output: dotnet/results/test-summary.md |
| 56 | + if: always() |
| 57 | + - name: Upload test summary |
| 58 | + uses: actions/upload-artifact@v3 |
| 59 | + with: |
| 60 | + name: dotnet |
| 61 | + path: dotnet/results/test-summary.md |
| 62 | + if: always() |
| 63 | + |
| 64 | + # This runs Java tests using the JUnit test framework |
| 65 | + java-junit: |
| 66 | + name: Java / JUint |
| 67 | + runs-on: ubuntu-latest |
| 68 | + |
| 69 | + steps: |
| 70 | + - name: Check out repository |
| 71 | + uses: actions/checkout@v3 |
| 72 | + - name: Build and test |
| 73 | + run: | |
| 74 | + ant |
| 75 | + working-directory: java-junit |
| 76 | + - name: Create test summary |
| 77 | + uses: test-summary/action@dist |
| 78 | + with: |
| 79 | + paths: java-junit/results/**/*.xml |
| 80 | + output: java-junit/results/test-summary.md |
| 81 | + if: always() |
| 82 | + - name: Upload test summary |
| 83 | + uses: actions/upload-artifact@v3 |
| 84 | + with: |
| 85 | + name: java-junit |
| 86 | + path: java-junit/results/test-summary.md |
| 87 | + if: always() |
| 88 | + |
| 89 | + # This runs JavaScript tests using the Mocha test framework |
| 90 | + javascript-mocha: |
| 91 | + name: JavaScript / Mocha |
| 92 | + runs-on: ubuntu-latest |
| 93 | + |
| 94 | + steps: |
| 95 | + - name: Check out repository |
| 96 | + uses: actions/checkout@v3 |
| 97 | + - name: Build and test |
| 98 | + run: | |
| 99 | + npm ci |
| 100 | + npm run test |
| 101 | + working-directory: javascript-mocha |
| 102 | + - name: Create test summary |
| 103 | + uses: test-summary/action@dist |
| 104 | + with: |
| 105 | + paths: javascript-mocha/results/**/*.xml |
| 106 | + output: javascript-mocha/results/test-summary.md |
| 107 | + if: always() |
| 108 | + - name: Upload test summary |
| 109 | + uses: actions/upload-artifact@v3 |
| 110 | + with: |
| 111 | + name: javascript-mocha |
| 112 | + path: javascript-mocha/results/test-summary.md |
| 113 | + if: always() |
| 114 | + |
| 115 | + # This runs JavaScript tests using the Node-Tap test framework |
| 116 | + javascript-tap: |
| 117 | + name: JavaScript / Node-Tap |
| 118 | + runs-on: ubuntu-latest |
| 119 | + |
| 120 | + steps: |
| 121 | + - name: Check out repository |
| 122 | + uses: actions/checkout@v3 |
| 123 | + - name: Build and test |
| 124 | + run: | |
| 125 | + npm ci |
| 126 | + npm run test |
| 127 | + working-directory: javascript-tap |
| 128 | + - name: Create test summary |
| 129 | + uses: test-summary/action@dist |
| 130 | + with: |
| 131 | + paths: javascript-tap/results/**/*.tap |
| 132 | + output: javascript-tap/results/test-summary.md |
| 133 | + if: always() |
| 134 | + - name: Upload test summary |
| 135 | + uses: actions/upload-artifact@v3 |
| 136 | + with: |
| 137 | + name: javascript-tap |
| 138 | + path: javascript-tap/results/test-summary.md |
| 139 | + if: always() |
0 commit comments