1
0
mirror of https://github.com/j178/prek.git synced 2026-04-25 02:11:36 +02:00

Rename project name to prefligit (#118)

* Rename project to `prefligit`

* Bump to 0.0.6

* Fix tests

* Add a rename note
This commit is contained in:
Jo
2024-12-03 13:20:00 +08:00
committed by GitHub
parent 247ed4a990
commit 8dfb3101ff
22 changed files with 249 additions and 234 deletions
+6 -6
View File
@@ -54,11 +54,11 @@ jobs:
set -euo pipefail
TARGET=${{ matrix.platform.target }}
ARCHIVE_NAME=pre-commit-rs-$TARGET
ARCHIVE_NAME=prefligit-$TARGET
ARCHIVE_FILE=$ARCHIVE_NAME.tar.gz
mkdir -p $ARCHIVE_NAME
cp target/$TARGET/release/pre-commit $ARCHIVE_NAME/pre-commit
cp target/$TARGET/release/prefligit $ARCHIVE_NAME/prefligit
tar czvf $ARCHIVE_FILE $ARCHIVE_NAME
shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256
- name: "Upload binary"
@@ -92,8 +92,8 @@ jobs:
- name: "Archive binary"
shell: bash
run: |
ARCHIVE_FILE=pre-commit-rs-${{ matrix.platform.target }}.zip
7z a $ARCHIVE_FILE ./target/${{ matrix.platform.target }}/release/pre-commit.exe
ARCHIVE_FILE=prefligit-${{ matrix.platform.target }}.zip
7z a $ARCHIVE_FILE ./target/${{ matrix.platform.target }}/release/prefligit.exe
sha256sum $ARCHIVE_FILE > $ARCHIVE_FILE.sha256
- name: "Upload binary"
uses: actions/upload-artifact@v4
@@ -128,11 +128,11 @@ jobs:
- name: "Archive binary"
run: |
TARGET=${{ matrix.platform.target }}
ARCHIVE_NAME=pre-commit-rs-$TARGET
ARCHIVE_NAME=prefligit-$TARGET
ARCHIVE_FILE=$ARCHIVE_NAME.tar.gz
mkdir -p $ARCHIVE_NAME
cp target/$TARGET/release/pre-commit $ARCHIVE_NAME/pre-commit
cp target/$TARGET/release/prefligit $ARCHIVE_NAME/prefligit
tar czvf $ARCHIVE_FILE $ARCHIVE_NAME
shasum -a 256 $ARCHIVE_FILE > $ARCHIVE_FILE.sha256
- name: "Upload binary"
+7 -7
View File
@@ -57,19 +57,19 @@ jobs:
# actions/checkout does not let us clone into anywhere outside ${{ github.workspace }}, so we have to copy the clone...
- name: Copy Git Repo to Dev Drive
run: |
Copy-Item -Path "${{ github.workspace }}" -Destination "${{ env.PRE_COMMIT_WORKSPACE }}" -Recurse
Copy-Item -Path "${{ github.workspace }}" -Destination "${{ env.PREFLIGIT_WORKSPACE }}" -Recurse
- uses: Swatinem/rust-cache@v2
with:
# Add a key to invalidate previous caches.
key: 1
workspaces: ${{ env.PRE_COMMIT_WORKSPACE }}
workspaces: ${{ env.PREFLIGIT_WORKSPACE }}
- name: "Install Rust toolchain"
run: rustup component add clippy
- name: "Clippy"
working-directory: ${{ env.PRE_COMMIT_WORKSPACE }}
working-directory: ${{ env.PREFLIGIT_WORKSPACE }}
run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings
cargo-shear:
@@ -151,14 +151,14 @@ jobs:
# actions/checkout does not let us clone into anywhere outside ${{ github.workspace }}, so we have to copy the clone...
- name: Copy Git Repo to Dev Drive
run: |
Copy-Item -Path "${{ github.workspace }}" -Destination "${{ env.PRE_COMMIT_WORKSPACE }}" -Recurse
Copy-Item -Path "${{ github.workspace }}" -Destination "${{ env.PREFLIGIT_WORKSPACE }}" -Recurse
- uses: Swatinem/rust-cache@v2
with:
workspaces: ${{ env.PRE_COMMIT_WORKSPACE }}
workspaces: ${{ env.PREFLIGIT_WORKSPACE }}
- name: "Install Rust toolchain"
working-directory: ${{ env.PRE_COMMIT_WORKSPACE }}
working-directory: ${{ env.PREFLIGIT_WORKSPACE }}
run: rustup show
- name: "Install cargo nextest"
@@ -172,7 +172,7 @@ jobs:
cache-local-path: ${{ env.DEV_DRIVE }}/uv-cache
- name: "Cargo test"
working-directory: ${{ env.PRE_COMMIT_WORKSPACE }}
working-directory: ${{ env.PREFLIGIT_WORKSPACE }}
run: |
cargo nextest show-config test-groups
cargo nextest run --workspace --status-level skip --failure-output immediate --no-fail-fast -j 8 --final-status-level slow
+5 -5
View File
@@ -1,7 +1,7 @@
# This creates a 10GB dev drive, and exports all required environment
# variables so that rustup, pre-commit and others all use the dev drive as much
# variables so that rustup, prefligit and others all use the dev drive as much
# as possible.
$Volume = New-VHD -Path C:/pre-commit_dev_drive.vhdx -SizeBytes 10GB |
$Volume = New-VHD -Path C:/prefligit_dev_drive.vhdx -SizeBytes 10GB |
Mount-VHD -Passthru |
Initialize-Disk -Passthru |
New-Partition -AssignDriveLetter -UseMaximumSize |
@@ -10,7 +10,7 @@ $Volume = New-VHD -Path C:/pre-commit_dev_drive.vhdx -SizeBytes 10GB |
Write-Output $Volume
$Drive = "$($Volume.DriveLetter):"
$Tmp = "$($Drive)/pre-commit-tmp"
$Tmp = "$($Drive)/prefligit-tmp"
# Create the directory ahead of time in an attempt to avoid race-conditions
New-Item $Tmp -ItemType Directory
@@ -19,8 +19,8 @@ Write-Output `
"DEV_DRIVE=$($Drive)" `
"TMP=$($Tmp)" `
"TEMP=$($Tmp)" `
"PRE_COMMIT_INTERNAL__TEST_DIR=$($Tmp)" `
"PREFLIGIT_INTERNAL__TEST_DIR=$($Tmp)" `
"RUSTUP_HOME=$($Drive)/.rustup" `
"CARGO_HOME=$($Drive)/.cargo" `
"PRE_COMMIT_WORKSPACE=$($Drive)/pre-commit" `
"PREFLIGIT_WORKSPACE=$($Drive)/prefligit" `
>> $env:GITHUB_ENV