diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a27399f..fd97ccb 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,10 +1,12 @@ version: 2 updates: -- package-ecosystem: cargo - directory: "/" - schedule: - interval: daily - time: "04:00" - open-pull-requests-limit: 10 - assignees: - - vbrandl + - package-ecosystem: cargo + directory: "/" + schedule: + interval: daily + time: "04:00" + open-pull-requests-limit: 10 + assignees: + - vbrandl + labels: + - dependencies diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 1e0a9a6..e9020c1 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -3,26 +3,19 @@ on: schedule: - cron: '0 1 * * *' push: + branches: + - master + pull_request: paths: - '**/Cargo.toml' - '**/Cargo.lock' - pull_request: + - ".cargo/audit.toml" jobs: security_audit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - - name: Cache cargo registry, index and build directory - uses: actions/cache@v2 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - ./target - key: audit-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - + - uses: actions/checkout@v3 - uses: actions-rs/audit-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7b00ba0..d7aa9da 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,8 +6,12 @@ on: - 'v[0-9]+.[0-9]+.[0-9]+' jobs: + tests: + uses: vbrandl/hoc/.github/workflows/rust.yml@master + publish: name: Publishing for ${{ matrix.os }} + needs: [tests] runs-on: ${{ matrix.os }} strategy: matrix: @@ -29,7 +33,7 @@ jobs: steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install stable toolchain uses: actions-rs/toolchain@v1 @@ -44,10 +48,10 @@ jobs: ~/.cargo/registry ~/.cargo/git ./target - key: release-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Cargo build - uses: actions-rs/cargo@v1 + uses: actions-rs/cargo@v3 with: command: build toolchain: ${{ matrix.rust }} @@ -74,3 +78,14 @@ jobs: target/${{ matrix.target }}/release/hoc-${{ matrix.artifact_prefix }}.sha256 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + changelog: + name: Update Changelog + needs: [tests] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: taiki-e/create-gh-release-action@v1 + with: + changelog: CHANGELOG.md + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index bcebb77..b25068b 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -1,13 +1,19 @@ -on: [push, pull_request] +on: + workflow_call: + push: + branches: + - master + pull_request: + schedule: + - cron: "0 0 * * *" jobs: - rustfmt: name: Rustfmt runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install stable toolchain uses: actions-rs/toolchain@v1 @@ -17,15 +23,6 @@ jobs: override: true components: rustfmt - - name: Cache cargo registry, index and build directory - uses: actions/cache@v2 - with: - path: | - ~/.cargo/registry - ~/.cargo/git - ./target - key: rustfmt-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - name: Check Formatting uses: actions-rs/cargo@v1 with: @@ -37,7 +34,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install stable toolchain uses: actions-rs/toolchain@v1 @@ -48,13 +45,13 @@ jobs: components: rustfmt - name: Cache cargo registry, index and build directory - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | ~/.cargo/registry ~/.cargo/git ./target - key: clippy-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Clippy Linting uses: actions-rs/cargo@v1 @@ -74,7 +71,7 @@ jobs: steps: - name: Checkout sources - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Install stable toolchain uses: actions-rs/toolchain@v1 @@ -84,13 +81,13 @@ jobs: override: true - name: Cache cargo registry, index and build directory - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | ~/.cargo/registry ~/.cargo/git ./target - key: test-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - name: Run Tests uses: actions-rs/cargo@v1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 62982d8..9bb9061 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +* Updated [`tracing-subscriber`](https://github.com/tokio-rs/tracing) from 0.3.15 to 0.3.16 ([#501]) +* Updated [`tracing`](https://github.com/tokio-rs/tracing) from 0.1.36 to 0.1.37 ([#502]) +* Updated [`serde_json`](https://github.com/serde-rs/json) from 1.0.85 to 1.0.86 ([#503]) * Updated [`tracing-bunyan-formatter`](https://github.com/LukeMathWalker/tracing-bunyan-formatter) from 0.3.3 to 0.3.4 ([#504]) +[#501]: https://github.com/vbrandl/hoc/pull/501 +[#502]: https://github.com/vbrandl/hoc/pull/502 +[#503]: https://github.com/vbrandl/hoc/pull/503 [#504]: https://github.com/vbrandl/hoc/pull/504 diff --git a/tests/util/mod.rs b/tests/util/mod.rs index a28e3a1..296f983 100644 --- a/tests/util/mod.rs +++ b/tests/util/mod.rs @@ -14,8 +14,9 @@ lazy_static::lazy_static! { pub struct TestApp { pub address: String, - repo_dir: TempDir, - cache_dir: TempDir, + // Those are unused but are hold to be dropped and deleted after the TestApp goes out of scope + _repo_dir: TempDir, + _cache_dir: TempDir, } pub async fn spawn_app() -> TestApp { @@ -26,15 +27,12 @@ pub async fn spawn_app() -> TestApp { let port = listener.local_addr().unwrap().port(); let address = format!("http://127.0.0.1:{}", port); - let repo_dir = tempdir().expect("Cannot create repo_dir"); - let cache_dir = tempdir().expect("Cannot create cache_dir"); + let _repo_dir = tempdir().expect("Cannot create repo_dir"); + let _cache_dir = tempdir().expect("Cannot create cache_dir"); let mut settings = Settings::load().expect("Failed to read configuration."); - settings.repodir = repo_dir.path().to_path_buf(); - settings.cachedir = cache_dir.path().to_path_buf(); - // configuration.database.database_name = Uuid::new_v4().to_string(); - - // let connection_pool = configure_database(&configuration.database).await; + settings.repodir = _repo_dir.path().to_path_buf(); + settings.cachedir = _cache_dir.path().to_path_buf(); let server = hoc::run(listener, settings) .await @@ -44,7 +42,7 @@ pub async fn spawn_app() -> TestApp { TestApp { address, - repo_dir, - cache_dir, + _repo_dir, + _cache_dir, } }