haj 0.2.1

fast, quiet, beautiful package managemer and tui for Arch Linux
name: ci

on:
  push:
    branches: [ "master", "main" ]
  pull_request:
    branches: [ "master", "main" ]

env:
  CARGO_TERM_COLOR: always

jobs:
  build_and_test:
    name: build, lint, and test
    runs-on: ubuntu-latest
    
    container: archlinux:latest 

    steps:
    - uses: actions/checkout@v4

    - name: install arch dependencies
      run: |
        pacman -Syu --noconfirm
        pacman -S --noconfirm rustup gcc pkgconf pacman
      
    - name: setup rust toolchain
      run: |
        rustup default stable
        rustup component add rustfmt clippy
        
    - name: cache cargo registry
      uses: actions/cache@v3
      with:
        path: |
          ~/.cargo/registry
          ~/.cargo/git
          target
        key: arch-cargo-${{ hashFiles('**/Cargo.lock') }}
        
    - name: check formatting
      run: cargo fmt -- --check
      
    - name: run clippy (linter)
      run: cargo clippy -- -D warnings
      
    - name: build (debug)
      run: cargo build --verbose