sunox 0.0.16

Generate AI music from your terminal via direct Suno web workflows
name: CI

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]
  schedule:
    - cron: '23 7 * * 1'

permissions:
  contents: read

concurrency:
  group: ci-${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  check:
    if: github.event_name != 'schedule'
    runs-on: ubuntu-24.04
    timeout-minutes: 30
    steps:
      - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
      - uses: dtolnay/rust-toolchain@4be7066ada62dd38de10e7b70166bc74ed198c30 # stable
        with:
          toolchain: stable
          components: clippy, rustfmt
      - run: cargo fmt --check
      - run: cargo clippy --locked --all-targets -- -D warnings
      - run: cargo test --locked
      - run: cargo build --release --locked

  msrv:
    if: github.event_name != 'schedule'
    runs-on: ubuntu-24.04
    timeout-minutes: 15
    steps:
      - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
      - uses: dtolnay/rust-toolchain@4e529fb27e59237866a6523e61ab248308c068b4 # 1.88.0
      - run: cargo check --locked

  platform-tests:
    name: platform-tests (${{ matrix.required_context }})
    if: github.event_name != 'schedule'
    timeout-minutes: 30
    strategy:
      matrix:
        include:
          - os: macos-14
            required_context: macos-latest
            rustflags: ''
          - os: windows-2022
            required_context: windows-latest
            rustflags: -C target-feature=+crt-static
    runs-on: ${{ matrix.os }}
    env:
      RUSTFLAGS: ${{ matrix.rustflags }}
    steps:
      - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
      - uses: dtolnay/rust-toolchain@4be7066ada62dd38de10e7b70166bc74ed198c30 # stable
        with:
          toolchain: stable
      - run: cargo test --locked

  security:
    runs-on: ubuntu-24.04
    timeout-minutes: 15
    steps:
      - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
      - uses: dtolnay/rust-toolchain@4be7066ada62dd38de10e7b70166bc74ed198c30 # stable
        with:
          toolchain: stable
      - run: cargo install cargo-audit --version 0.22.2 --locked
      - run: cargo audit

  workflow-lint:
    if: github.event_name != 'schedule'
    runs-on: ubuntu-24.04
    timeout-minutes: 10
    steps:
      - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
      - run: go run github.com/rhysd/actionlint/cmd/actionlint@v1.7.7

  release-linux-smoke:
    if: github.event_name != 'schedule'
    runs-on: ubuntu-24.04
    timeout-minutes: 30
    steps:
      - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7
      - uses: dtolnay/rust-toolchain@4e529fb27e59237866a6523e61ab248308c068b4 # 1.88.0
        with:
          targets: x86_64-unknown-linux-gnu
      - name: Install pinned Zig toolchain
        run: |
          cargo install cargo-zigbuild --version 0.23.0 --locked
          python3 -m venv "${RUNNER_TEMP}/zig-venv"
          "${RUNNER_TEMP}/zig-venv/bin/pip" install --disable-pip-version-check 'ziglang==0.15.2'
          "${RUNNER_TEMP}/zig-venv/bin/python" - <<'PY' >> "${GITHUB_PATH}"
          import pathlib, ziglang
          print(pathlib.Path(ziglang.__file__).parent)
          PY
      - run: cargo zigbuild --release --locked --target x86_64-unknown-linux-gnu.2.28
      - name: Verify artifact baseline
        run: |
          binary='target/x86_64-unknown-linux-gnu/release/sunox'
          "${binary}" --version
          max_glibc="$(readelf --version-info "${binary}" | grep -o 'GLIBC_[0-9.]*' | sort -V | tail -1)"
          test -n "${max_glibc}"
          test "$(printf '%s\n' GLIBC_2.28 "${max_glibc}" | sort -V | tail -1)" = 'GLIBC_2.28'