diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 000000000..f2ffb34af --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,26 @@ +name: Lint + +on: ["push", "pull_request"] + +jobs: + static-analysis: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + components: rustfmt, clippy + - name: Run `cargo fmt` + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all -- --check + - name: Run `cargo clippy` + uses: actions-rs/cargo@v1 + with: + command: clippy + args: -- -D warnings + diff --git a/.github/workflows/ci.yml b/.github/workflows/linux.yml similarity index 66% rename from .github/workflows/ci.yml rename to .github/workflows/linux.yml index 6e5c2e704..e3973e4a7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/linux.yml @@ -1,29 +1,8 @@ -name: CI +name: Linux on: ["push", "pull_request"] jobs: - static-analysis: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - components: rustfmt, clippy - - name: Run `cargo fmt` - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check - - name: Run `cargo clippy` - uses: actions-rs/cargo@v1 - with: - command: clippy - args: -- -D warnings - build-git: runs-on: ubuntu-latest strategy: @@ -56,7 +35,7 @@ jobs: path: git.tar.gz if-no-files-found: error - test: + run-tests: runs-on: ubuntu-latest needs: build-git strategy: @@ -78,16 +57,3 @@ jobs: - name: Run Rust tests run: PATH_TO_GIT="$PWD"/git cargo test - test-windows: - runs-on: windows-latest - steps: - - uses: actions/checkout@v2 - - name: Set up Rust - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - - name: Run Rust tests - run: | - $env:PATH_TO_GIT='C:\Program Files\Git\cmd\git.exe' - cargo test diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 000000000..5b01520f2 --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,21 @@ +name: macOS + +on: + schedule: + # Run Mondays and Thursdays at 6:40AM UTC. + - cron: '40 6 * * 1,4' + +jobs: + run-tests: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + - name: Run tests + run: | + export PATH_TO_GIT=$(which git) + cargo test diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 000000000..18d02a5a8 --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,18 @@ +name: Windows + +on: ["push", "pull_request"] + +jobs: + run-tests: + runs-on: windows-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Rust + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + - name: Run tests + run: | + $env:PATH_TO_GIT='C:\Program Files\Git\cmd\git.exe' + cargo test diff --git a/README.md b/README.md index 0270591b3..c9f75ce20 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # Branchless workflow for Git -[![CI](https://github.com/arxanas/git-branchless/workflows/CI/badge.svg)](https://github.com/arxanas/git-branchless/actions?query=workflow%3ACI+branch%3Amaster) +[![Linux](https://github.com/arxanas/git-branchless/actions/workflows/linux.yml/badge.svg)](https://github.com/arxanas/git-branchless/actions/workflows/linux.yml) +[![Windows](https://github.com/arxanas/git-branchless/actions/workflows/windows.yml/badge.svg)](https://github.com/arxanas/git-branchless/actions/worksflows/windows.yml) +[![macOS](https://github.com/arxanas/git-branchless/actions/workflows/macos.yml/badge.svg)](https://github.com/arxanas/git-branchless/actions/workflows/macos.yml) [![crates.io](http://meritbadge.herokuapp.com/git-branchless)](https://crates.io/crates/git-branchless) `git-branchless` is a suite of tools to help you **visualize**, **navigate**, **manipulate**, and **repair** your commit history. It's based off of the branchless Mercurial workflows at large companies such as Google and Facebook.