Skip to content

feat: display settings and signout button in left sidebar #36

feat: display settings and signout button in left sidebar

feat: display settings and signout button in left sidebar #36

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- "**"
jobs:
changed-files:
name: Check changed files
runs-on: ubuntu-latest
outputs:
all_changed_files: ${{ steps.changed.outputs.all_changed_files }}
client_any_changed: ${{ steps.changed.outputs.client_any_changed }}
server_any_changed: ${{ steps.changed.outputs.server_any_changed }}
steps:
- uses: actions/checkout@v4
- uses: tj-actions/changed-files@v45
id: changed
with:
files_yaml: |
client: ['apps/client/**']
server: ['apps/server/**']
_client:
needs: changed-files
if: needs.changed-files.outputs.client_any_changed == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- run: |
bun install
bun add -D concurrently
- name: Format, lint, typecheck, build
run: |
bun concurrently \
-c auto \
-n format,lint-jstx,typecheck \
'bun dprint check' \
'bun biome check --config-path=.biome.jsonc' \
'bun tsc -p apps/client/tsconfig.json' \
'cd apps/client && bun vite build'
client:
needs: _client
# workaround for https://github.com/orgs/community/discussions/13690
# (branch protection rules always require their defined status check(s) even if the corresponding jobs are skipped)
# https://stackoverflow.com/questions/69354003/github-action-job-fire-when-previous-job-skipped/77066140#77066140
if: ${{ !(failure() || cancelled()) }}
runs-on: ubuntu-latest
steps:
- name: Client checks OK
run: exit 0
typos:
needs: changed-files
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: crate-ci/[email protected]
with:
files: ${{ needs.changed-files.outputs.all_changed_files }}
_server:
needs: changed-files
if: needs.changed-files.outputs.server_any_changed == 'true'
name: Cargo test, clippy and doc
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: macos-latest
target: x86_64-apple-darwin
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: windows-latest
target: x86_64-pc-windows-gnu
permissions:
contents: write
security-events: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
components: clippy, rustfmt
target: ${{ matrix.target }}
- name: Setup cache
uses: Swatinem/rust-cache@v2
- name: Cargo test
run: cargo test --target ${{ matrix.target }}
- name: Cargo fmt
if: ${{ matrix.os == 'ubuntu-latest' }}
run: cargo fmt -- --check
- name: Cargo clippy
if: ${{ matrix.os == 'ubuntu-latest' }}
run: cargo clippy --all-targets --all-features --message-format=json > clippy_result.json
continue-on-error: true
- name: Install clippy-sarif sarif-fmt (require cargo)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
cargo install clippy-sarif sarif-fmt
cat clippy_result.json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
- name: Upload analysis results to GitHub
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: rust-clippy-results.sarif
wait-for-processing: true
- name: Cargo doc
if: ${{ github.ref == 'refs/heads/main' && matrix.os == 'ubuntu-latest'}}
run: |
cargo doc --no-deps --document-private-items
echo "<meta http-equiv='refresh' content='0; url=freedit'>" > target/doc/index.html
rm target/doc/.lock
- name: Upload artifact
if: ${{ github.ref == 'refs/heads/main' && matrix.os == 'ubuntu-latest'}}
uses: actions/upload-pages-artifact@v3
with:
path: "target/doc"
server:
needs: _server
if: ${{ !(failure() || cancelled()) }}
runs-on: ubuntu-latest
steps:
- name: Server checks OK (passed or skipped)
run: exit 0
Deploy:
needs: server
name: Deploy to GitHub Pages
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
pages: write
id-token: write
steps:
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: "github-pages"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4