From e2ff9a5911b72e1ad4ae87eb323559f6a9f2ee85 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 15:22:19 -0700 Subject: [PATCH 1/4] Move to GitHub Actions CI --- .github/codecov.yml | 21 +++++++++++++++ .github/workflows/coverage.yml | 34 ++++++++++++++++++++++++ .github/workflows/features.yml | 23 ++++++++++++++++ .github/workflows/minimal.yml | 39 +++++++++++++++++++++++++++ .github/workflows/msrv.yml | 21 +++++++++++++++ .github/workflows/os-check.yml | 24 +++++++++++++++++ .github/workflows/style.yml | 48 ++++++++++++++++++++++++++++++++++ .github/workflows/test.yml | 33 +++++++++++++++++++++++ Cargo.toml | 5 ---- README.md | 1 - README.tpl | 2 -- azure-pipelines.yml | 38 --------------------------- rustfmt.toml | 1 - tarpaulin.toml | 4 --- 14 files changed, 243 insertions(+), 51 deletions(-) create mode 100644 .github/codecov.yml create mode 100644 .github/workflows/coverage.yml create mode 100644 .github/workflows/features.yml create mode 100644 .github/workflows/minimal.yml create mode 100644 .github/workflows/msrv.yml create mode 100644 .github/workflows/os-check.yml create mode 100644 .github/workflows/style.yml create mode 100644 .github/workflows/test.yml delete mode 100644 azure-pipelines.yml delete mode 100644 rustfmt.toml delete mode 100644 tarpaulin.toml diff --git a/.github/codecov.yml b/.github/codecov.yml new file mode 100644 index 00000000..ff4f571d --- /dev/null +++ b/.github/codecov.yml @@ -0,0 +1,21 @@ +# ref: https://docs.codecov.com/docs/codecovyml-reference +coverage: + # Hold ourselves to a high bar + range: 85..100 + round: down + precision: 1 + status: + # ref: https://docs.codecov.com/docs/commit-status + project: + default: + # Avoid false negatives + threshold: 1% + +# Test files aren't important for coverage +ignore: + - "tests" + +# Make comments less noisy +comment: + layout: "files" + require_changes: yes diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 00000000..ede2a34e --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,34 @@ +on: + push: + branches: [main] + pull_request: +name: coverage +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: llvm-tools-preview + - name: Install cargo-llvm-cov + uses: taiki-e/install-action@cargo-llvm-cov + - name: Generate code coverage + run: cargo llvm-cov --all-features --lcov --output-path lcov.info + env: # set this explicitly so integration tests will run + FAKTORY_URL: tcp://faktory:7419 + - name: Upload to codecov.io + uses: codecov/codecov-action@v2 + with: + fail_ci_if_error: true + services: + faktory: + image: contribsys/faktory:latest + ports: + - 7419:7419 + - 7420:7420 diff --git a/.github/workflows/features.yml b/.github/workflows/features.yml new file mode 100644 index 00000000..ac5e18e0 --- /dev/null +++ b/.github/workflows/features.yml @@ -0,0 +1,23 @@ +on: + push: + branches: [main] + pull_request: +name: cargo hack +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + - uses: actions/checkout@v3 + with: + submodules: true + - name: Install cargo-hack + uses: taiki-e/install-action@cargo-hack + - name: cargo hack + uses: actions-rs/cargo@v1 + with: + command: hack + args: --feature-powerset check --all-targets diff --git a/.github/workflows/minimal.yml b/.github/workflows/minimal.yml new file mode 100644 index 00000000..2556e82f --- /dev/null +++ b/.github/workflows/minimal.yml @@ -0,0 +1,39 @@ +on: + push: + branches: [main] + pull_request: +name: With dependencies at minimal versions +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + - uses: actions/checkout@v3 + with: + submodules: true + - name: cargo update -Zminimal-versions + uses: actions-rs/cargo@v1 + with: + command: update + toolchain: nightly + args: -Zminimal-versions + - name: cargo test + uses: actions-rs/cargo@v1 + with: + command: test + args: --all-features --all-targets + env: # set this explicitly so integration tests will run + FAKTORY_URL: tcp://faktory:7419 + services: + faktory: + image: contribsys/faktory:latest + ports: + - 7419:7419 + - 7420:7420 diff --git a/.github/workflows/msrv.yml b/.github/workflows/msrv.yml new file mode 100644 index 00000000..47b105cc --- /dev/null +++ b/.github/workflows/msrv.yml @@ -0,0 +1,21 @@ +on: + push: + branches: [main] + pull_request: +name: Minimum Supported Rust Version +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: 1.57.0 + override: true + - uses: actions/checkout@v3 + with: + submodules: true + - name: cargo +1.57.0 check + uses: actions-rs/cargo@v1 + with: + command: check diff --git a/.github/workflows/os-check.yml b/.github/workflows/os-check.yml new file mode 100644 index 00000000..c56b6995 --- /dev/null +++ b/.github/workflows/os-check.yml @@ -0,0 +1,24 @@ +on: + push: + branches: [main] + pull_request: +name: os check +jobs: + os-check: + runs-on: ${{ matrix.os }} + name: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [macos-latest, windows-latest] + steps: + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + - uses: actions/checkout@v3 + - name: cargo test + uses: actions-rs/cargo@v1 + with: + command: test + args: --all-features --all-targets diff --git a/.github/workflows/style.yml b/.github/workflows/style.yml new file mode 100644 index 00000000..7a583f29 --- /dev/null +++ b/.github/workflows/style.yml @@ -0,0 +1,48 @@ +on: + push: + branches: [main] + pull_request: +name: lint +jobs: + style: + runs-on: ubuntu-latest + name: ${{ matrix.toolchain }} + strategy: + fail-fast: false + matrix: + toolchain: [stable, beta] + steps: + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.toolchain }} + components: rustfmt, clippy + - uses: actions/checkout@v3 + with: + submodules: true + - name: cargo fmt --check + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --check + - name: cargo clippy + uses: actions-rs/clippy-check@v1 + if: always() + with: + token: ${{ secrets.GITHUB_TOKEN }} + doc: + runs-on: ubuntu-latest + steps: + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: nightly + - uses: actions/checkout@v3 + - name: cargo doc + uses: actions-rs/cargo@v1 + with: + toolchain: nightly + command: doc + args: --no-deps --all-features + env: + RUSTDOCFLAGS: --cfg docsrs diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..b461d73a --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,33 @@ +on: + push: + branches: [main] + pull_request: +name: cargo test +jobs: + test: + runs-on: ubuntu-latest + name: ubuntu / ${{ matrix.toolchain }} + strategy: + matrix: + toolchain: [stable, beta, nightly] + steps: + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.toolchain }} + - uses: actions/checkout@v3 + with: + submodules: true + - name: cargo test + uses: actions-rs/cargo@v1 + with: + command: test + args: --all-features --all-targets + env: # set this explicitly so integration tests will run + FAKTORY_URL: tcp://faktory:7419 + services: + faktory: + image: contribsys/faktory:latest + ports: + - 7419:7419 + - 7420:7420 diff --git a/Cargo.toml b/Cargo.toml index 3e690218..8d2e0376 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,11 +12,6 @@ repository = "https://github.com/jonhoo/faktory-rs.git" keywords = ["faktory", "api-bindings", "work-server", "job-server"] categories = ["api-bindings", "asynchronous", "network-programming"] -[badges] -azure-devops = { project = "jonhoo/jonhoo", pipeline = "faktory", build = "19" } -codecov = { repository = "jonhoo/faktory-rs", branch = "master", service = "github" } -maintenance = { status = "passively-maintained" } - [features] default = [] tls = ["native-tls"] diff --git a/README.md b/README.md index 69374b70..bce45270 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@ [![Crates.io](https://img.shields.io/crates/v/faktory.svg)](https://crates.io/crates/faktory) [![Documentation](https://docs.rs/faktory/badge.svg)](https://docs.rs/faktory/) -[![Build Status](https://dev.azure.com/jonhoo/jonhoo/_apis/build/status/faktory?branchName=master)](https://dev.azure.com/jonhoo/jonhoo/_build/latest?definitionId=19&branchName=master) [![Codecov](https://codecov.io/github/jonhoo/faktory-rs/coverage.svg?branch=master)](https://codecov.io/gh/jonhoo/faktory-rs) [![dependency status](https://deps.rs/repo/github/jonhoo/faktory-rs/status.svg)](https://deps.rs/repo/github/jonhoo/faktory-rs) diff --git a/README.tpl b/README.tpl index 1a8e7911..9e6f090f 100644 --- a/README.tpl +++ b/README.tpl @@ -2,8 +2,6 @@ [![Crates.io](https://img.shields.io/crates/v/faktory.svg)](https://crates.io/crates/faktory) [![Documentation](https://docs.rs/faktory/badge.svg)](https://docs.rs/faktory/) -[![Build Status](https://travis-ci.org/jonhoo/faktory-rs.svg?branch=master)](https://travis-ci.org/jonhoo/faktory-rs) -[![Windows Build Status](https://ci.appveyor.com/api/projects/status/github/jonhoo/faktory-rs?svg=true&branch=master)](https://ci.appveyor.com/project/jonhoo/faktory-rs) [![Codecov](https://codecov.io/github/jonhoo/faktory-rs/coverage.svg?branch=master)](https://codecov.io/gh/jonhoo/faktory-rs) [![dependency status](https://deps.rs/repo/github/jonhoo/faktory-rs/status.svg)](https://deps.rs/repo/github/jonhoo/faktory-rs) diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 06d5b2a4..00000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,38 +0,0 @@ -jobs: - - template: default.yml@templates - parameters: - minrust: 1.57 - - job: integration - displayName: cargo test (real) - pool: - vmImage: ubuntu-latest - services: - faktory: faktory - steps: - - template: install-rust.yml@templates - - script: cargo test --tests - displayName: cargo test - env: # set this explicitly so integration tests will run - FAKTORY_URL: tcp://127.0.0.1:7419 - - template: coverage.yml@templates - parameters: - token: $(CODECOV_TOKEN_SECRET) - nightly: true - services: - faktory: faktory - env: - FAKTORY_URL: tcp://faktory:7419 - -resources: - repositories: - - repository: templates - type: github - name: crate-ci/azure-pipelines - ref: refs/heads/v0.4 - endpoint: jonhoo - containers: - - container: faktory - image: contribsys/faktory:latest - ports: - - 7419:7419 - - 7420:7420 diff --git a/rustfmt.toml b/rustfmt.toml deleted file mode 100644 index 32a9786f..00000000 --- a/rustfmt.toml +++ /dev/null @@ -1 +0,0 @@ -edition = "2018" diff --git a/tarpaulin.toml b/tarpaulin.toml deleted file mode 100644 index 30b7233c..00000000 --- a/tarpaulin.toml +++ /dev/null @@ -1,4 +0,0 @@ -[default] -features = ["tls"] -forward-signals = true -run-types = ["Doctests", "Tests"] From 0f743f059ce2096ef533973f7c01e7d64d617ad1 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 15:29:19 -0700 Subject: [PATCH 2/4] Correct host for faktory server --- .github/workflows/coverage.yml | 2 +- .github/workflows/minimal.yml | 4 ++-- .github/workflows/test.yml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index ede2a34e..5e6569c8 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -21,7 +21,7 @@ jobs: - name: Generate code coverage run: cargo llvm-cov --all-features --lcov --output-path lcov.info env: # set this explicitly so integration tests will run - FAKTORY_URL: tcp://faktory:7419 + FAKTORY_URL: tcp://127.0.0.1:7419 - name: Upload to codecov.io uses: codecov/codecov-action@v2 with: diff --git a/.github/workflows/minimal.yml b/.github/workflows/minimal.yml index 2556e82f..27d47d33 100644 --- a/.github/workflows/minimal.yml +++ b/.github/workflows/minimal.yml @@ -29,8 +29,8 @@ jobs: with: command: test args: --all-features --all-targets - env: # set this explicitly so integration tests will run - FAKTORY_URL: tcp://faktory:7419 + env: # set this explicitly so integration tests will run + FAKTORY_URL: tcp://127.0.0.1:7419 services: faktory: image: contribsys/faktory:latest diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b461d73a..27891976 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,8 +23,8 @@ jobs: with: command: test args: --all-features --all-targets - env: # set this explicitly so integration tests will run - FAKTORY_URL: tcp://faktory:7419 + env: # set this explicitly so integration tests will run + FAKTORY_URL: tcp://127.0.0.1:7419 services: faktory: image: contribsys/faktory:latest From ede15c35edad7180032c4f3c6243fe856e4e4717 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 15:32:08 -0700 Subject: [PATCH 3/4] Correct required version of fnv --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 8d2e0376..03aa964e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,7 @@ rand = "0.8" chrono = { version = "0.4", features = ["serde", "clock"], default-features = false } url = "2" atomic-option = "0.1" -fnv = "1.0.3" +fnv = "1.0.5" native-tls = { version = "0.2", optional = true } clap = { version = "3", optional = true } thiserror = "1.0.30" From 934c92168f057aedf5c08e4d26f4436d34bb408f Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Sat, 17 Sep 2022 15:38:51 -0700 Subject: [PATCH 4/4] Correct required version of clap --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 03aa964e..ac83ad8e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ url = "2" atomic-option = "0.1" fnv = "1.0.5" native-tls = { version = "0.2", optional = true } -clap = { version = "3", optional = true } +clap = { version = "3.1.0", optional = true } thiserror = "1.0.30" [dev-dependencies]