Skip to content

feat: allow adding/removing usages by path #695

feat: allow adding/removing usages by path

feat: allow adding/removing usages by path #695

Workflow file for this run

name: CLI
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
jobs:
test:
strategy:
matrix:
# macos-15-intel is x86, macos-latest is arm64
os: [ubuntu-22.04, ubuntu-24.04-arm, windows-latest, windows-11-arm, macos-15-intel, macos-latest]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- name: Cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- uses: taiki-e/install-action@cargo-hack
- name: Clippy
run: cargo hack clippy --each-feature --no-dev-deps --features std --ignore-unknown-features -- --deny warnings
- name: Clippy for tests
run: cargo clippy --all-targets --all-features -- --deny warnings
- name: Format
run: cargo fmt --check
- name: Set up git user
run: |
git config --global user.email "user@sysand.org"
git config --global user.name "Test User"
- name: Test Core
run: cargo test --package sysand-core --verbose --features filesystem,js,python,alltests
- name: Test CLI
run: cargo test --package sysand --verbose --features alltests
build:
strategy:
matrix:
# macos-15-intel is x86, macos-latest is arm64
os: [ubuntu-22.04, ubuntu-24.04-arm, windows-latest, windows-11-arm, macos-15-intel, macos-latest]
runs-on: ${{ matrix.os }}
needs: [test]
steps:
- uses: actions/checkout@v6
- name: Cache
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build
run: cargo build --bin sysand --release
- name: Create the distribution directory
run: mkdir -p dist
- name: Copy binaries
if: matrix.os == 'windows-latest' || matrix.os == 'windows-11-arm'
run: cp target/release/sysand.exe dist/sysand-${{ matrix.os }}.exe
- name: Copy binaries
if: matrix.os != 'windows-latest' && matrix.os != 'windows-11-arm'
run: cp target/release/sysand dist/sysand-${{ matrix.os }}
- name: Upload binaries
uses: actions/upload-artifact@v5
with:
name: sysand-cli-${{ matrix.os }}
path: dist/*
nightly-release:
name: Nightly Release
runs-on: ubuntu-latest
needs: [test, build]
if: ${{ github.ref == 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/') }}
permissions:
# Use to sign the release artifacts
id-token: write
# Used to upload release artifacts
contents: write
# Used to generate artifact attestation
attestations: write
steps:
- uses: actions/download-artifact@v6
with:
path: artifacts
merge-multiple: true
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v3
with:
subject-path: 'artifacts/*'
- name: Rename artifacts
shell: bash
run: |
mv artifacts/sysand-ubuntu-22.04 artifacts/sysand-linux-x86_64
mv artifacts/sysand-ubuntu-24.04-arm artifacts/sysand-linux-arm64
mv artifacts/sysand-windows-latest.exe artifacts/sysand-windows-x86_64.exe
mv artifacts/sysand-windows-11-arm.exe artifacts/sysand-windows-arm64.exe
mv artifacts/sysand-macos-15-intel artifacts/sysand-macos-x86_64
mv artifacts/sysand-macos-latest artifacts/sysand-macos-arm64
- name: Create release tag
shell: bash
run: echo "TAG_NAME=$(date +v-%Y-%m-%d-%H%M)" >> $GITHUB_ENV
- name: Create a nightly release
uses: softprops/action-gh-release@v2
with:
prerelease: true
files: |
artifacts/*
overwrite_files: false
tag_name: ${{ env.TAG_NAME }}
name: Nightly Release ${{ env.TAG_NAME }}
release:
name: Release
runs-on: ubuntu-latest
needs: [test, build]
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
permissions:
# Use to sign the release artifacts
id-token: write
# Used to upload release artifacts
contents: write
# Used to generate artifact attestation
attestations: write
steps:
- uses: actions/download-artifact@v6
with:
path: artifacts
merge-multiple: true
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v3
with:
subject-path: 'artifacts/*'
- name: Rename artifacts
shell: bash
run: |
mv artifacts/sysand-ubuntu-22.04 artifacts/sysand-linux-x86_64
mv artifacts/sysand-ubuntu-24.04-arm artifacts/sysand-linux-arm64
mv artifacts/sysand-windows-latest.exe artifacts/sysand-windows-x86_64.exe
mv artifacts/sysand-windows-11-arm.exe artifacts/sysand-windows-arm64.exe
mv artifacts/sysand-macos-15-intel artifacts/sysand-macos-x86_64
mv artifacts/sysand-macos-latest artifacts/sysand-macos-arm64
- name: Create a release
uses: softprops/action-gh-release@v2
with:
make_latest: true
files: |
artifacts/*
overwrite_files: false
name: Release ${{ github.event.inputs.tag_name }}