diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 8dc77c0..4e63709 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -2,37 +2,38 @@ name: Bug report about: Report an issue with the bar not working as expected title: '' -labels: bug +labels: T:Bug assignees: '' --- **Describe the bug** -> A clear and concise description of what the bug is. + -**To Reproduce** +**To reproduce** Steps to reproduce the behavior: -1. Go to '...' -2. Click on '....' -3. Scroll down to '....' -4. See error + +1. Add module `clock` +2. Click popup +3. Observe X is broken **Expected behavior** -> A clear and concise description of what you expected to happen. + **System information:** - - Distro: [e.g. Arch Linux, Ubuntu 22.10] +- Distro: [e.g. Arch Linux, Ubuntu 22.10] - Compositor: [e.g. Sway] - - Ironbar version: [e.g. 0.8.0] +- Ironbar version: [e.g. 0.16.1] **Configuration** -> Share your bar configuration and stylesheet as applicable: +
Config ``` ``` +
@@ -41,10 +42,11 @@ Steps to reproduce the behavior: ```css ``` + **Additional context** -> Add any other context about the problem here. + **Screenshots** -> If applicable, add screenshots to help explain your problem. + diff --git a/.github/scripts/ubuntu_setup.sh b/.github/scripts/ubuntu_setup.sh index db9ca76..b36dfea 100755 --- a/.github/scripts/ubuntu_setup.sh +++ b/.github/scripts/ubuntu_setup.sh @@ -17,5 +17,7 @@ $SUDO apt-get update && $SUDO apt-get install --assume-yes \ libssl-dev${CROSS_DEB_ARCH:+:$CROSS_DEB_ARCH} \ libgtk-3-dev${CROSS_DEB_ARCH:+:$CROSS_DEB_ARCH} \ libgtk-layer-shell-dev${CROSS_DEB_ARCH:+:$CROSS_DEB_ARCH} \ + libinput-dev${CROSS_DEB_ARCH:+:$CROSS_DEB_ARCH} \ + libdbusmenu-gtk3-dev${CROSS_DEB_ARCH:+:$CROSS_DEB_ARCH} \ libpulse-dev${CROSS_DEB_ARCH:+:$CROSS_DEB_ARCH} \ libluajit-5.1-dev${CROSS_DEB_ARCH:+:$CROSS_DEB_ARCH} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8f8b4dd..9f5e386 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,8 +4,17 @@ on: workflow_dispatch: push: branches: [ "master" ] + paths: + - 'src/**/*' + - 'Cargo.*' + - 'build.rs' pull_request: branches: [ "master" ] + paths: + - 'src/**/*' + - 'Cargo.*' + - 'build.rs' + - '.github/workflows/build.yml' env: CARGO_TERM_COLOR: always @@ -24,6 +33,7 @@ jobs: clippy-base: runs-on: ubuntu-latest + container: ghcr.io/jakestanger/ironbar-build:master name: 'Clippy (Base features)' steps: - uses: actions/checkout@v4 @@ -31,9 +41,6 @@ jobs: - uses: Swatinem/rust-cache@v2 name: Cache dependencies - - name: Install build deps - run: ./.github/scripts/ubuntu_setup.sh - - name: Clippy run: cargo clippy --no-default-features --features config+json env: @@ -43,6 +50,7 @@ jobs: clippy-all: runs-on: ubuntu-latest + container: ghcr.io/jakestanger/ironbar-build:master name: 'Clippy (All features)' steps: - uses: actions/checkout@v4 @@ -50,16 +58,16 @@ jobs: - uses: Swatinem/rust-cache@v2 name: Cache dependencies - - name: Install build deps - run: ./.github/scripts/ubuntu_setup.sh - - name: Clippy run: cargo clippy --all-targets --all-features + env: + RUSTFLAGS: '-W clippy::unwrap_used' build: name: 'Build & Test' runs-on: ubuntu-latest + container: ghcr.io/jakestanger/ironbar-build:master steps: - uses: actions/checkout@v4 @@ -67,9 +75,6 @@ jobs: - uses: Swatinem/rust-cache@v2 name: Cache dependencies - - name: Install build deps - run: ./.github/scripts/ubuntu_setup.sh - - name: Build run: cargo build --verbose @@ -77,3 +82,62 @@ jobs: uses: actions-rs/cargo@v1 with: command: test + + feature-checks: + name: 'Check feature flag' + runs-on: ubuntu-latest + container: ghcr.io/jakestanger/ironbar-build:master + + strategy: + matrix: + feature: + - http + - ipc + - cli + - config+all + - config+json + - config+yaml + - config+toml + - config+corn + - config+ron + - bindmode+all + - bindmode+sway + - bindmode+hyprland + - cairo + - clipboard + - clock + - custom + - focused + - keyboard+all + - keyboard+sway + - keyboard+hyprland + - label + - launcher + - menu + - music+all + - music+mpris + - music+mpd + - network_manager + - notifications + - sys_info + - script + - tray + - upower + - volume + - workspaces+all + - workspaces+sway + - workspaces+hyprland + - workspaces+niri + - schema + + steps: + - uses: actions/checkout@v4 + + - uses: Swatinem/rust-cache@v2 + name: Cache dependencies + + - name: Check + run: cargo check --no-default-features --features ${{ matrix.feature }} + env: + # Allow some warnings through as we'll never get it perfect + RUSTFLAGS: '-A unused-imports -A unused-variables -A unused-mut -A dead-code' \ No newline at end of file diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index bb86387..5205a24 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -41,6 +41,7 @@ jobs: publish-crate: name: 'Publish Crate' runs-on: ubuntu-latest + container: ghcr.io/jakestanger/ironbar-build:master steps: - uses: actions/checkout@v3 @@ -50,9 +51,6 @@ jobs: toolchain: stable override: true - - name: Install build deps - run: ./.github/scripts/ubuntu_setup.sh - - name: Publish crate uses: katyo/publish-crates@v1 with: @@ -62,6 +60,7 @@ jobs: publish-schema: name: 'Publish Schema' runs-on: ubuntu-latest + container: ghcr.io/jakestanger/ironbar-build:master steps: - uses: actions/checkout@v3 @@ -69,11 +68,11 @@ jobs: - uses: Swatinem/rust-cache@v2 name: Cache dependencies - - name: Install build deps - run: ./.github/scripts/ubuntu_setup.sh + - name: Ensure target folder + run: mkdir -p target - name: Build schema - run: cargo build --features schema -- --print-schema > target/schema-${{ github.ref_name }}.json + run: cargo run --features schema -- --print-schema > target/schema-${{ github.ref_name }}.json - name: Copy file via SSH uses: appleboy/scp-action@v0.1.7 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..f2898d0 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,105 @@ +name: Docker + +# This workflow uses actions that are not certified by GitHub. +# They are provided by a third-party and are governed by +# separate terms of service, privacy policy, and support +# documentation. + +on: + schedule: + - cron: '32 23 * * *' + push: + branches: [ "master" ] + paths: + - '.github/scripts/ubuntu_setup.sh' + - 'Dockerfile' + # Publish semver tags as releases. + tags: [ 'v*.*.*' ] + + pull_request: + branches: [ "master" ] + paths: + - '.github/scripts/ubuntu_setup.sh' + - 'Dockerfile' + +env: + # Use docker.io for Docker Hub if empty + REGISTRY: ghcr.io + # github.repository as / + IMAGE_NAME: ${{ github.repository }}-build + + +jobs: + build: + + runs-on: ubuntu-latest + permissions: + contents: read + packages: write + # This is used to complete the identity challenge + # with sigstore/fulcio when running outside of PRs. + id-token: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + # Install the cosign tool except on PR + # https://github.com/sigstore/cosign-installer + - name: Install cosign + if: github.event_name != 'pull_request' + uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 #v3.5.0 + with: + cosign-release: 'v2.2.4' + + # Set up BuildKit Docker container builder to be able to build + # multi-platform images and export cache + # https://github.com/docker/setup-buildx-action + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0 + + # Login against a Docker registry except on PR + # https://github.com/docker/login-action + - name: Log into registry ${{ env.REGISTRY }} + if: github.event_name != 'pull_request' + uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + # Extract metadata (tags, labels) for Docker + # https://github.com/docker/metadata-action + - name: Extract Docker metadata + id: meta + uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0 + with: + images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + + # Build and push Docker image with Buildx (don't push on PR) + # https://github.com/docker/build-push-action + - name: Build and push Docker image + id: build-and-push + uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max + + # Sign the resulting Docker image digest except on PRs. + # This will only write to the public Rekor transparency log when the Docker + # repository is public to avoid leaking data. If you would like to publish + # transparency data even for private images, pass --force to cosign below. + # https://github.com/sigstore/cosign + - name: Sign the published Docker image + if: ${{ github.event_name != 'pull_request' }} + env: + # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable + TAGS: ${{ steps.meta.outputs.tags }} + DIGEST: ${{ steps.build-and-push.outputs.digest }} + # This step uses the identity token to provision an ephemeral certificate + # against the sigstore community Fulcio instance. + run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST} diff --git a/.github/workflows/schema.yml b/.github/workflows/schema.yml index be79ca2..932a487 100644 --- a/.github/workflows/schema.yml +++ b/.github/workflows/schema.yml @@ -4,6 +4,11 @@ on: workflow_dispatch: push: branches: [ "master" ] + paths: + - 'src/**/*' + - 'Cargo.*' + - 'build.rs' + - '.github/workflows/schema.yml' env: CARGO_TERM_COLOR: always @@ -13,6 +18,7 @@ jobs: publish-schema: name: 'Publish Schema' runs-on: ubuntu-latest + container: ghcr.io/jakestanger/ironbar-build:master steps: - uses: actions/checkout@v3 @@ -20,9 +26,6 @@ jobs: - uses: Swatinem/rust-cache@v2 name: Cache dependencies - - name: Install build deps - run: ./.github/scripts/ubuntu_setup.sh - - name: Build run: cargo build --features schema diff --git a/.github/workflows/wiki.yml b/.github/workflows/wiki.yml index 0dd4a70..efd9869 100644 --- a/.github/workflows/wiki.yml +++ b/.github/workflows/wiki.yml @@ -3,6 +3,8 @@ name: Sync Wiki on: push: branches: [ "master" ] + paths: + - 'docs/**/*' jobs: build: diff --git a/.idea/git_toolbox_blame.xml b/.idea/git_toolbox_blame.xml new file mode 100644 index 0000000..7dc1249 --- /dev/null +++ b/.idea/git_toolbox_blame.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/runConfigurations/Run__Live_Config_.xml b/.idea/runConfigurations/Run__Live_Config_.xml index f5f4c0e..c54a85c 100644 --- a/.idea/runConfigurations/Run__Live_Config_.xml +++ b/.idea/runConfigurations/Run__Live_Config_.xml @@ -11,7 +11,7 @@