|
| 1 | +# This is a basic workflow to help you get started with Actions |
| 2 | + |
| 3 | +name: Unit Tests |
| 4 | + |
| 5 | +# Controls when the action will run. Triggers the workflow on push or pull request |
| 6 | +# events but only for the master branch |
| 7 | +on: |
| 8 | + push: |
| 9 | + branches: [ MINI404 ] |
| 10 | + pull_request: |
| 11 | + branches: [ MINI404 ] |
| 12 | + |
| 13 | +# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
| 14 | +jobs: |
| 15 | + # This workflow contains a single job called "build" |
| 16 | + build_linux: |
| 17 | + # The type of runner that the job will run on |
| 18 | + runs-on: ubuntu-latest |
| 19 | + # if: "!contains(github.event.head_commit.message, 'NO_BUILD')" |
| 20 | + # # Steps represent a sequence of tasks that will be executed as part of the job |
| 21 | + steps: |
| 22 | + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it |
| 23 | + - name: Checkout ${{ github.event.pull_request.head.ref }} |
| 24 | + uses: actions/checkout@v3 |
| 25 | + if: ${{ github.event.pull_request }} |
| 26 | + with: |
| 27 | + repository: ${{ github.repository }} |
| 28 | + ref: ${{ github.event.pull_request.head.sha }} |
| 29 | + submodules: false |
| 30 | + |
| 31 | + - name: Checkout ${{ github.event.ref }} |
| 32 | + uses: actions/checkout@v3 |
| 33 | + if: ${{ !github.event.pull_request }} |
| 34 | + with: |
| 35 | + repository: ${{ github.repository }} |
| 36 | + ref: ${{ github.event.ref }} |
| 37 | + submodules: false |
| 38 | + |
| 39 | + - name: Cache packages |
| 40 | + uses: actions/cache@v3.0.11 |
| 41 | + id: cache-pkgs |
| 42 | + with: |
| 43 | + path: "packages" |
| 44 | + key: "${{ runner.os }}-packages-1_0_0" |
| 45 | + restore-keys: ${{ runner.os }}-packages- |
| 46 | + |
| 47 | + - name: Setup cache dir |
| 48 | + if: ${{ ! steps.cache-valgrind.outputs.cache-hit }} |
| 49 | + run: mkdir -p packages/partial |
| 50 | + |
| 51 | + - name: Install packages |
| 52 | + run: | |
| 53 | + sudo apt-get update |
| 54 | + sudo apt-get -o Dir::Cache::Archives=`pwd`/packages install libelf-dev libglew-dev freeglut3-dev ninja-build libusb-1.0.0-dev libgtk-3-dev lcov |
| 55 | +
|
| 56 | + - name: Cache permissions |
| 57 | + run: sudo chmod -R 744 packages |
| 58 | + |
| 59 | + - name: Test Symlink |
| 60 | + run: ln -s ${{ runner.workspace }}/MINI404/hw/arm/prusa ${{ runner.workspace }}/MINI404/tests/qtest/ |
| 61 | + |
| 62 | + - name: Configure build |
| 63 | + run: cd ${{ runner.workspace }}/MINI404 && ./configure --target-list="buddy-softmmu" --enable-libusb --enable-gtk --enable-gcov |
| 64 | + |
| 65 | + - name: Build qemu-system-buddy |
| 66 | + run: cd ${{ runner.workspace }}/MINI404/build && ninja |
| 67 | + |
| 68 | + # Right now this will fail some tests due to SIGABRT from the CPU crashing. Ignore it until that's fixed. |
| 69 | + - name: Run QTest |
| 70 | + run: cd ${{ runner.workspace }}/MINI404/build && make check-qtest-buddy -j4 |
| 71 | + continue-on-error: true |
| 72 | + |
| 73 | + - name: Generate Coverage report |
| 74 | + run: cd ${{ runner.workspace }}/MINI404/build && make coverage-html -j4 |
| 75 | + |
| 76 | + - name: Strip down Coverage report |
| 77 | + run: cd ${{ runner.workspace }}/MINI404/build/meson-logs && lcov -extract coverage.info '*/arm/prusa/*' --rc lcov_branch_coverage=1 --output-file=c2.info |
| 78 | + |
| 79 | + - name: Upload to codecov.io |
| 80 | + uses: codecov/codecov-action@v3 |
| 81 | + with: |
| 82 | + # Comma-separated list of files to upload |
| 83 | + files: ${{ runner.workspace }}/MINI404/build/meson-logs/c2.info |
| 84 | + # Specify whether or not CI build should fail if Codecov runs into an error during upload |
| 85 | + fail_ci_if_error: true |
| 86 | + # Comma-separated list, see the README for options and their usage |
| 87 | + # functionalities: # optional |
| 88 | + # Specify whether the Codecov output should be verbose |
| 89 | + verbose: true |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | + |
0 commit comments