diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ef8223e..a3c261a 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,6 +1,10 @@ name: Ruff Lint -on: [push, pull_request] +on: + pull_request: + types: [opened, synchronize, reopened] + push: + branches: [main] jobs: ruff: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 246ba0d..60da3eb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,29 +1,47 @@ name: Test on: - push: - branches: [main] pull_request: + types: [opened, synchronize, reopened] + push: branches: [main] jobs: test: runs-on: ubuntu-latest + + concurrency: + # Distinct keys: + # • PR runs → pr- + # • main push → main- + # • other push (branch) → branch- + group: | + ${{ github.event_name == 'pull_request' + && format('pr-{0}', github.event.pull_request.number) + || ( + github.ref == 'refs/heads/main' + && format('main-{0}', github.sha) + || format('branch-{0}', github.ref_name) + ) }} + cancel-in-progress: true + steps: - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: "3.11" + - name: Install uv run: | curl -LsSf https://astral.sh/uv/install.sh | sh echo "$HOME/.cargo/bin" >> $GITHUB_PATH + - name: Install dependencies - run: | - uv sync - - name: Install shinobi - run: | - uv pip install -e . + run: uv sync + + - name: Install project + run: uv pip install -e . + - name: Run tests - run: | - uv run pytest + run: uv run pytest diff --git a/README.md b/README.md index 38bdcbb..065e9d0 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,10 @@ ## Installation +Right now the only way to install shinobi is through pip. Soon we will make it available through installer / brew ```bash # Install Shinobi -pip install shinobi +pip install shinobi ``` ## Usage diff --git a/pyproject.toml b/pyproject.toml index c60ef48..5213560 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "shinobi" -version = "0.1.1" +version = "0.1.2" description = "Enhanced project initialization tool built on top of uv" authors = [ { name = "Ian Timmis" } diff --git a/shinobi/templates/ci/github_workflows/lint.yml b/shinobi/templates/ci/github_workflows/lint.yml index ef8223e..a3c261a 100644 --- a/shinobi/templates/ci/github_workflows/lint.yml +++ b/shinobi/templates/ci/github_workflows/lint.yml @@ -1,6 +1,10 @@ name: Ruff Lint -on: [push, pull_request] +on: + pull_request: + types: [opened, synchronize, reopened] + push: + branches: [main] jobs: ruff: diff --git a/shinobi/templates/ci/github_workflows/test.yml b/shinobi/templates/ci/github_workflows/test.yml index 4a453ce..60da3eb 100644 --- a/shinobi/templates/ci/github_workflows/test.yml +++ b/shinobi/templates/ci/github_workflows/test.yml @@ -1,26 +1,47 @@ name: Test on: - push: - branches: [main] pull_request: + types: [opened, synchronize, reopened] + push: branches: [main] jobs: test: runs-on: ubuntu-latest + + concurrency: + # Distinct keys: + # • PR runs → pr- + # • main push → main- + # • other push (branch) → branch- + group: | + ${{ github.event_name == 'pull_request' + && format('pr-{0}', github.event.pull_request.number) + || ( + github.ref == 'refs/heads/main' + && format('main-{0}', github.sha) + || format('branch-{0}', github.ref_name) + ) }} + cancel-in-progress: true + steps: - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 with: python-version: "3.11" + - name: Install uv run: | curl -LsSf https://astral.sh/uv/install.sh | sh echo "$HOME/.cargo/bin" >> $GITHUB_PATH + - name: Install dependencies - run: | - uv sync + run: uv sync + + - name: Install project + run: uv pip install -e . + - name: Run tests - run: | - uv run pytest + run: uv run pytest