feat(rm2fb): Add comprehensive tests for ControlSocket #287
This file contains hidden or 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: Build | |
| on: [push, pull_request] | |
| env: | |
| REGISTRY: ghcr.io | |
| IMAGE_NAME: 'ghcr.io/timower/rm-docker:main-qemu-toltec' | |
| jobs: | |
| nix-build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| lfs: 'true' | |
| - uses: cachix/install-nix-action@v31 | |
| with: | |
| github_access_token: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: cachix/cachix-action@v15 | |
| with: | |
| name: rm2-stuff | |
| authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | |
| # Skip qcow2 vm images and system tarballs. | |
| pushFilter: '(qcow2$|tarball-armv7l-unknown-linux-gnueabihf$|-rm-emu-|rm-nix-test|test-driver)' | |
| - run: nix build | |
| - run: nix build .#dev-cross | |
| - run: nix build .#dev-rm2-toolchain | |
| - run: nix build .#nixosConfigurations.example.config.system.build.toplevel | |
| - run: nix flake check -L --max-jobs 1 | |
| build: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ghcr.io/toltec-dev/base:v3.1 | |
| steps: | |
| - name: Install Deps | |
| run: apt-get update && apt-get install -y git git-lfs xxd | |
| - uses: actions/checkout@v4 | |
| with: | |
| lfs: 'true' | |
| - name: Configure CMake | |
| run: cmake --preset release-toltec | |
| - name: Build | |
| run: cmake --build build/release-toltec | |
| - name: Package | |
| run: cmake --build build/release-toltec --target package | |
| - name: Upload | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: package | |
| path: build/release-toltec/*.ipk | |
| build-host: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| lfs: 'true' | |
| - name: Install Deps | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y ninja-build libsdl2-dev xxd llvm libevdev-dev libsystemd-dev | |
| - name: Configure CMake | |
| run: cmake --preset dev-host | |
| - name: Build | |
| run: cmake --build build/dev-host | |
| - name: Unit Tests | |
| run: cmake --build build/dev-host --target make-coverage | |
| - name: Upload Coverage | |
| uses: codecov/codecov-action@v4 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} # required | |
| files: ./build/dev-host/report.lcov | |
| fail_ci_if_error: false # optional (default = false) | |
| verbose: true # optional (default = false) | |
| - name: Upload Test Binary | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: host-package | |
| path: build/dev-host/tools/rm2fb-emu/rm2fb-test | |
| # integration-tests: | |
| # runs-on: ubuntu-latest | |
| # needs: [build, build-host] | |
| # strategy: | |
| # matrix: | |
| # fw_version: ['3.3.2.1666', '3.20.0.92'] | |
| # steps: | |
| # - uses: actions/checkout@v4 | |
| # with: | |
| # lfs: 'true' | |
| # - name: Install Deps | |
| # run: sudo apt-get install -y libsdl2-2.0-0 | |
| # - name: Download package | |
| # uses: actions/download-artifact@v4 | |
| # with: | |
| # name: package | |
| # path: packages/ | |
| # - name: Download host package | |
| # uses: actions/download-artifact@v4 | |
| # with: | |
| # name: host-package | |
| # path: tools/ | |
| # - name: Login to GitHub Container Registry | |
| # uses: docker/login-action@v3 | |
| # with: | |
| # registry: ${{ env.REGISTRY }} | |
| # username: ${{ github.actor }} | |
| # password: ${{ secrets.GITHUB_TOKEN }} | |
| # - name: Integration Tests | |
| # id: intest | |
| # run: | | |
| # chmod +x ./tools/rm2fb-test | |
| # mkdir ./tmp | |
| # ./test/integration/test.sh \ | |
| # ${{ env.IMAGE_NAME }}-${{ matrix.fw_version }} \ | |
| # ./packages/ \ | |
| # ./tools/rm2fb-test \ | |
| # ./tmp | |
| # - name: Upload test results | |
| # if: ${{ failure() && steps.intest.conclusion == 'failure' }} | |
| # uses: actions/upload-artifact@v4 | |
| # with: | |
| # name: test_failures_${{ matrix.fw_version }} | |
| # path: ./tmp | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
| steps: | |
| - name: Download package | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: package | |
| - run: ls -la | |
| - name: Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| draft: true | |
| files: ./* | |