Skip to content

Commit

Permalink
migrate to clap derive api (railwayapp#679)
Browse files Browse the repository at this point in the history
* migrate to clap derive api

upgrade clap version

* fix short option conflict

* bump MSRV

* fix ci toolchain
  • Loading branch information
nebulatgs authored Nov 17, 2022
1 parent 7b7873d commit 55b20d9
Show file tree
Hide file tree
Showing 6 changed files with 263 additions and 322 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
on:
push:
branches:
- main
- main
paths-ignore:
- 'docs/**'
- "docs/**"
pull_request:
paths-ignore:
- 'docs/**'
- "docs/**"

name: CI

Expand Down Expand Up @@ -47,7 +47,7 @@ jobs:
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout sources
uses: actions/checkout@v3

Expand All @@ -58,7 +58,7 @@ jobs:
toolchain: stable
override: true
components: rustfmt, clippy

- uses: Swatinem/rust-cache@v2

- name: Run cargo fmt
Expand All @@ -72,7 +72,7 @@ jobs:
with:
command: clippy
# Set linting rules for clippy
args: --all-targets --all-features -- -D warnings
args: --all-targets --all-features -- -D warnings

test-plan:
name: Test Suite
Expand All @@ -83,12 +83,12 @@ jobs:
outputs:
matrix: ${{ steps.docker-prep.outputs.matrix }}
if: "!contains(github.event.head_commit.message, '(cargo-release)')"
steps:
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout sources
uses: actions/checkout@v3

Expand All @@ -100,7 +100,7 @@ jobs:
override: true

- uses: Swatinem/rust-cache@v2

- name: Run cargo test
uses: actions-rs/cargo@v1
with:
Expand All @@ -120,12 +120,12 @@ jobs:
strategy:
matrix: ${{fromJson(needs.test-plan.outputs.matrix)}}
if: "!contains(github.event.head_commit.message, '(cargo-release)')"
steps:
steps:
- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout sources
uses: actions/checkout@v3

Expand Down Expand Up @@ -156,19 +156,19 @@ jobs:
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout sources
uses: actions/checkout@v3

- name: Install 1.59 rust toolchain
- name: Install 1.60 rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: 1.59
toolchain: 1.60.0
override: true

- uses: Swatinem/rust-cache@v2

- name: Run cargo test
uses: actions-rs/cargo@v1
with:
Expand Down
75 changes: 62 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description = "Generate an OCI compliant image based off app source"
readme = "README.md"
homepage = "https://github.com/railwayapp/nixpacks"
repository = "https://github.com/railwayapp/nixpacks"
rust-version = "1.59"
rust-version = "1.60"
exclude = ["examples/", "docs/"]

[[bin]]
Expand All @@ -26,7 +26,7 @@ members = ["test-helper"]

[dependencies]
anyhow = "1.0.64"
clap = { version = "3.2.20", features = ["std"], default-features = false }
clap = { version = "4.0.25", features = ["derive"] }
colored = "2.0.0"
globset = { default-features = false, version = "0.4.9" }
walkdir = "2.3.2"
Expand All @@ -35,7 +35,9 @@ regex = "1.6.0"
serde = { version = "1.0.144", default-features = false }
serde_json = "1.0.85"
serde_yaml = "0.8.26"
serde_with = { features = ["macros"], default-features = false, version = "1.14.0" }
serde_with = { features = [
"macros",
], default-features = false, version = "1.14.0" }
tempdir = "0.3.7"
toml = "0.5.9"
uuid = { version = "1.1.2", features = ["v4"], default-features = false }
Expand All @@ -52,7 +54,7 @@ actix-web = "4"
sanitize-filename = "0.4"
futures-util = "0.3"
futures = "0.3"
portpicker = "0.1.1"
portpicker = "0.1.1"
tokio = { version = "1.21.2", features = ["full"] }
async-trait = "0.1.58"

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![CI](https://github.com/railwayapp/bb/actions/workflows/ci.yml/badge.svg)](https://github.com/railwayapp/bb/actions/workflows/ci.yml)
[![Crates.io](https://img.shields.io/crates/v/nixpacks)](https://crates.io/crates/nixpacks)
[![Rust: 1.59+](https://img.shields.io/badge/rust-1.59+-93450a)](https://blog.rust-lang.org/2022/02/24/Rust-1.59.0.html)
[![Rust: 1.60+](https://img.shields.io/badge/rust-1.60+-93450a)](https://blog.rust-lang.org/2022/04/07/Rust-1.60.0.html)

**App source + Nix packages + Docker = Image**

Expand Down
2 changes: 1 addition & 1 deletion docs/pages/docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ scoop install nixpacks

Build and install from source using [Rust](https://www.rust-lang.org/tools/install).

> Nixpacks currently requires a [Rust](https://www.rust-lang.org/tools/install) version no lower than [1.59](https://blog.rust-lang.org/2022/02/24/Rust-1.59.0.html)
> Nixpacks currently requires a [Rust](https://www.rust-lang.org/tools/install) version no lower than [1.60](https://blog.rust-lang.org/2022/04/07/Rust-1.60.0.html)
```sh
cargo install nixpacks
Expand Down
Loading

0 comments on commit 55b20d9

Please sign in to comment.