feat: detect running on desktop, disable power/lid events for it #231
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: Test | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| jobs: | |
| tests: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| lfs: true | |
| - name: Fetch and checkout LFS objects | |
| run: | | |
| git lfs fetch --all | |
| git lfs checkout | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: go.mod | |
| cache: true | |
| - name: Install dependencies | |
| run: go mod download | |
| - name: Install golangci-lint | |
| uses: golangci/golangci-lint-action@v8 | |
| with: | |
| version: v2.4.0 | |
| args: --help | |
| - name: Install GoReleaser | |
| uses: goreleaser/goreleaser-action@v6 | |
| with: | |
| version: 2.11.2 | |
| install-only: true | |
| - uses: actions/setup-python@v5 | |
| name: Install python | |
| with: | |
| python-version: 3.9 | |
| cache: pip | |
| - run: make install/.toc.stamp | |
| name: Install gh-md-toc | |
| - run: pip install -r requirements.txt | |
| name: Install python dependencies | |
| - uses: pre-commit/action@v3.0.1 | |
| name: Run pre-commit | |
| - name: Format | |
| run: | | |
| make fmt | |
| git diff --exit-code -- . ':(exclude)preview/output/*.gif' || (echo "Code is not formatted, run 'make fmt' locally" && exit 1) | |
| - name: Lint | |
| run: make lint | |
| - name: Unit tests | |
| run: make test/unit | |
| - name: Integration tests | |
| run: make test/integration | |
| - name: Create coverage artifact | |
| run: make coverage | |
| - name: Upload coverage markdown as artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-xml | |
| path: coverage.xml | |
| retention-days: 7 | |
| - uses: codecov/codecov-action@v5 | |
| if: github.ref == 'refs/heads/main' | |
| with: | |
| files: ./coverage.xml | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| nix: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 5 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - uses: DeterminateSystems/nix-installer-action@main | |
| - uses: DeterminateSystems/magic-nix-cache-action@main | |
| - name: Test Nix build | |
| run: | | |
| nix flake check | |
| nix build | |
| ./result/bin/hyprdynamicmonitors --version |