snapshot of https://github.com/ActivityWatch/aw-server-rust.git (master, 2026-09-16; blobs > 131072B omitted)
Some checks failed
Build / ubuntu-latest (push) Failing after 5s
Build / Android (push) Failing after 2s
Build / Code coverage (push) Failing after 2s
Lint / format (push) Failing after 3s
Lint / clippy (push) Failing after 3s
Build / macOS-latest (push) Has been cancelled
Build / windows-latest (push) Has been cancelled
Some checks failed
Build / ubuntu-latest (push) Failing after 5s
Build / Android (push) Failing after 2s
Build / Code coverage (push) Failing after 2s
Lint / format (push) Failing after 3s
Lint / clippy (push) Failing after 3s
Build / macOS-latest (push) Has been cancelled
Build / windows-latest (push) Has been cancelled
This commit is contained in:
136
.github/workflows/build.yml
vendored
Normal file
136
.github/workflows/build.yml
vendored
Normal file
@@ -0,0 +1,136 @@
|
||||
name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: ${{ matrix.os }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macOS-latest]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- name: Set up Rust
|
||||
id: toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
- name: Cache cargo build
|
||||
uses: actions/cache@v6
|
||||
if: runner.os != 'macOS' # cache doesn't seem to behave nicely on macOS, see: https://github.com/ActivityWatch/aw-server-rust/issues/180
|
||||
env:
|
||||
cache-name: cargo-build-target
|
||||
with:
|
||||
path: target
|
||||
# key needs to contain cachekey due to https://github.com/ActivityWatch/aw-server-rust/issues/180
|
||||
key: ${{ runner.os }}-${{ env.cache-name }}-${{ steps.toolchain.outputs.cachekey }}-${{ hashFiles('**/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-${{ env.cache-name }}-${{ steps.toolchain.outputs.cachekey }}-
|
||||
- name: Build
|
||||
run: cargo build --workspace --verbose
|
||||
- name: Run tests
|
||||
run: cargo test --workspace --verbose
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
# TODO: These binaries are debug builds
|
||||
name: binaries-${{runner.os}}
|
||||
path: |
|
||||
target/*/aw-server
|
||||
target/*/aw-server.exe
|
||||
target/*/aw-sync
|
||||
target/*/aw-sync.exe
|
||||
|
||||
build-android:
|
||||
name: Android
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- name: Verify Android build script cwd handling
|
||||
run: bash ./scripts/test-compile-android-cwd.sh
|
||||
- name: Set up Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
- name: Cache cargo build
|
||||
uses: actions/cache@v6
|
||||
env:
|
||||
cache-name: cargo-build-target-android
|
||||
with:
|
||||
path: target
|
||||
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/Cargo.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-${{ env.cache-name }}-
|
||||
- name: Build
|
||||
run: |
|
||||
export ANDROID_NDK_HOME= # needed because GitHub Actions sets it by default...
|
||||
make android
|
||||
- uses: actions/upload-artifact@v7
|
||||
with:
|
||||
# TODO: These binaries are debug builds
|
||||
name: binaries-android
|
||||
path: |
|
||||
target/*/*/libaw_server.so
|
||||
|
||||
# Code coverage using tarpaulin
|
||||
# Works better than grcov, but not as many fancy features (no branch coverage, no LLVM)
|
||||
# See: https://shift.click/blog/github-actions-rust/#code-coverage
|
||||
build-coverage-tarpaulin:
|
||||
name: Code coverage
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- name: Set up Rust
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
# Note: If you need to combine the coverage info of multiple
|
||||
# feature sets, you need a `.tarpaulin.toml` config file, see
|
||||
# the link above for those docs.
|
||||
- name: Install cargo-tarpaulin
|
||||
run: cargo install cargo-tarpaulin
|
||||
|
||||
- name: Run tests with coverage
|
||||
run: cargo tarpaulin --out Xml
|
||||
|
||||
# Note: closed-source code needs to provide a token,
|
||||
# but open source code does not.
|
||||
- name: Upload to codecov.io
|
||||
uses: codecov/codecov-action@v7
|
||||
|
||||
# Code coverage using grcov
|
||||
#build-coverage-grcov:
|
||||
# name: Build with coverage
|
||||
# runs-on: ubuntu-latest
|
||||
|
||||
# steps:
|
||||
# - uses: actions/checkout@v7
|
||||
# - name: Set up Rust nightly
|
||||
# uses: actions-rs/toolchain@v1
|
||||
# with:
|
||||
# profile: minimal
|
||||
# toolchain: nightly
|
||||
# override: true
|
||||
# - name: Cache cargo build
|
||||
# uses: actions/cache@v6
|
||||
# env:
|
||||
# cache-name: cargo-build-target-coverage
|
||||
# with:
|
||||
# path: target
|
||||
# key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/Cargo.lock') }}
|
||||
# restore-keys: |
|
||||
# ${{ runner.os }}-${{ env.cache-name }}-
|
||||
# - name: Install llvm-tools
|
||||
# run: |
|
||||
# rustup component add llvm-tools-preview
|
||||
# - name: Download grcov
|
||||
# run: |
|
||||
# curl -L https://github.com/mozilla/grcov/releases/latest/download/grcov-x86_64-unknown-linux-gnu.tar.bz2 | tar jxf -
|
||||
# - name: Run tests with coverage
|
||||
# run: |
|
||||
# # Add cwd to path to find grcov
|
||||
# export PATH=$PATH:.
|
||||
# make coverage-lcov COVERAGE_CACHE=1
|
||||
# - name: Upload coverage files
|
||||
# run: bash <(curl -s https://codecov.io/bash) -f target/debug/lcov.info;
|
||||
61
.github/workflows/dependabot-automerge.yml
vendored
Normal file
61
.github/workflows/dependabot-automerge.yml
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
name: Dependabot Auto-merge
|
||||
|
||||
# Run in the trusted `workflow_run` context and merge Dependabot PRs directly
|
||||
# with the repository token instead of depending on an external PAT.
|
||||
|
||||
on:
|
||||
workflow_run:
|
||||
types:
|
||||
- completed
|
||||
workflows:
|
||||
# List all required workflow names here.
|
||||
- Build
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
auto_merge:
|
||||
name: Auto-merge
|
||||
runs-on: ubuntu-latest
|
||||
if: >-
|
||||
github.event.workflow_run.conclusion == 'success' &&
|
||||
github.event.workflow_run.event == 'pull_request' &&
|
||||
github.actor == 'dependabot[bot]'
|
||||
|
||||
steps:
|
||||
- uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9
|
||||
with:
|
||||
script: |
|
||||
const pr = context.payload.workflow_run.pull_requests?.[0];
|
||||
if (!pr) {
|
||||
core.setFailed("No pull request found in workflow_run payload.");
|
||||
return;
|
||||
}
|
||||
|
||||
const { data: pull } = await github.rest.pulls.get({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
pull_number: pr.number,
|
||||
});
|
||||
|
||||
if (pull.state !== "open") {
|
||||
core.info(`PR #${pull.number} is already ${pull.state}; nothing to do.`);
|
||||
return;
|
||||
}
|
||||
|
||||
if (pull.draft) {
|
||||
core.info(`PR #${pull.number} is a draft; skipping.`);
|
||||
return;
|
||||
}
|
||||
|
||||
await github.rest.pulls.merge({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
pull_number: pull.number,
|
||||
merge_method: "squash",
|
||||
sha: context.payload.workflow_run.head_sha,
|
||||
});
|
||||
|
||||
core.info(`Merged Dependabot PR #${pull.number}.`);
|
||||
35
.github/workflows/lint.yml
vendored
Normal file
35
.github/workflows/lint.yml
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
name: Lint
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
jobs:
|
||||
format:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- name: Set up Rust nightly
|
||||
uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: nightly
|
||||
components: rustfmt
|
||||
override: true
|
||||
- name: Check formatting
|
||||
run: cargo fmt -- --check
|
||||
|
||||
clippy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v7
|
||||
- name: Set up Rust stable
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
components: clippy
|
||||
- name: Run clippy
|
||||
run: cargo clippy --workspace -- -D warnings
|
||||
Reference in New Issue
Block a user