mirror of
https://github.com/harivansh-afk/deskctl.git
synced 2026-04-17 18:02:33 +00:00
add tests to CI
This commit is contained in:
parent
e9784a7f94
commit
3c08e6003d
1 changed files with 64 additions and 1 deletions
65
.github/workflows/ci.yml
vendored
65
.github/workflows/ci.yml
vendored
|
|
@ -5,6 +5,8 @@ name: CI
|
||||||
# runs-on: ${{ vars.UVA_RUNNER || 'ubuntu-latest' }}
|
# runs-on: ${{ vars.UVA_RUNNER || 'ubuntu-latest' }}
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches: [main]
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
@ -14,8 +16,65 @@ permissions:
|
||||||
packages: write
|
packages: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
validate:
|
||||||
|
name: Validate
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
|
with:
|
||||||
|
components: clippy
|
||||||
|
|
||||||
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: 22
|
||||||
|
cache: pnpm
|
||||||
|
cache-dependency-path: site/pnpm-lock.yaml
|
||||||
|
|
||||||
|
- name: Enable corepack
|
||||||
|
run: corepack enable
|
||||||
|
|
||||||
|
- name: Install site dependencies
|
||||||
|
run: pnpm --dir site install --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Install system dependencies
|
||||||
|
run: sudo apt-get update && sudo apt-get install -y libx11-dev libxtst-dev
|
||||||
|
|
||||||
|
- name: Format check
|
||||||
|
run: make fmt-check
|
||||||
|
|
||||||
|
- name: Clippy
|
||||||
|
run: make lint
|
||||||
|
|
||||||
|
- name: Unit tests
|
||||||
|
run: make test-unit
|
||||||
|
|
||||||
|
- name: Site format check
|
||||||
|
run: make site-format-check
|
||||||
|
|
||||||
|
integration:
|
||||||
|
name: Integration (Xvfb)
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: dtolnay/rust-toolchain@stable
|
||||||
|
|
||||||
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
|
||||||
|
- name: Install system dependencies
|
||||||
|
run: sudo apt-get update && sudo apt-get install -y libx11-dev libxtst-dev xvfb
|
||||||
|
|
||||||
|
- name: Xvfb integration tests
|
||||||
|
run: make test-integration
|
||||||
|
|
||||||
changes:
|
changes:
|
||||||
name: Changes
|
name: Changes
|
||||||
|
needs: [validate, integration]
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
rust: ${{ steps.check.outputs.rust }}
|
rust: ${{ steps.check.outputs.rust }}
|
||||||
|
|
@ -32,9 +91,11 @@ jobs:
|
||||||
filters: |
|
filters: |
|
||||||
rust:
|
rust:
|
||||||
- 'src/**'
|
- 'src/**'
|
||||||
|
- 'tests/**'
|
||||||
- 'Cargo.toml'
|
- 'Cargo.toml'
|
||||||
- 'Cargo.lock'
|
- 'Cargo.lock'
|
||||||
- 'docker/**'
|
- 'docker/**'
|
||||||
|
- 'Makefile'
|
||||||
|
|
||||||
- name: Set outputs
|
- name: Set outputs
|
||||||
id: check
|
id: check
|
||||||
|
|
@ -69,7 +130,7 @@ jobs:
|
||||||
build:
|
build:
|
||||||
name: Build (${{ matrix.target }})
|
name: Build (${{ matrix.target }})
|
||||||
needs: changes
|
needs: changes
|
||||||
if: needs.changes.outputs.rust == 'true'
|
if: github.event_name != 'pull_request' && needs.changes.outputs.rust == 'true'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: true
|
fail-fast: true
|
||||||
|
|
@ -132,6 +193,7 @@ jobs:
|
||||||
update-manifests:
|
update-manifests:
|
||||||
name: Update Manifests
|
name: Update Manifests
|
||||||
needs: [changes, build]
|
needs: [changes, build]
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
@ -165,6 +227,7 @@ jobs:
|
||||||
release:
|
release:
|
||||||
name: Release
|
name: Release
|
||||||
needs: [changes, build, update-manifests]
|
needs: [changes, build, update-manifests]
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue