diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 517ede1..2a1afe6 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -27,6 +27,8 @@ jobs: - os: windows-latest target: x86_64-pc-windows-msvc runs-on: ${{matrix.os}} + env: + RUSTFLAGS: "-D warnings" steps: - uses: actions/checkout@v2 - name: Install Stable @@ -43,8 +45,7 @@ jobs: cargo --version cargo clippy --version - name: Build - run: RUSTFLAGS="-D warnings" cargo build --all --verbose - shell: bash + run: cargo build --all --verbose - name: Test run: cargo test --all --verbose - name: Clippy @@ -66,11 +67,24 @@ jobs: run: | cargo run --package update-readme toc git diff --no-ext-diff --quiet --exit-code + - name: Install `mdbook` + uses: peaceiris/actions-mdbook@v1 + with: + mdbook-version: latest + - name: Build Book + run: mdbook build book --dest-dir ../www/book + - name: Deploy Book + if: github.ref == 'refs/heads/master' + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{secrets.GITHUB_TOKEN}} + publish_branch: gh-pages + publish_dir: ./www - name: Package id: package if: startsWith(github.ref, 'refs/tags/v') - run: ./bin/package ${{github.ref}} ${{matrix.os}} ${{matrix.target}} shell: bash + run: ./bin/package ${{github.ref}} ${{matrix.os}} ${{matrix.target}} - name: Publish uses: softprops/action-gh-release@v1 if: startsWith(github.ref, 'refs/tags/v') diff --git a/.github/workflows/www.yaml b/.github/workflows/www.yaml deleted file mode 100644 index 5f813c8..0000000 --- a/.github/workflows/www.yaml +++ /dev/null @@ -1,28 +0,0 @@ -name: WWW - -on: - push: - branches: - - master - pull_request: - branches: - - master - -jobs: - all: - name: All - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Build - uses: peaceiris/actions-mdbook@v1 - with: - mdbook-version: latest - - run: mdbook build book --dest-dir ../www/book - - name: Deploy - uses: peaceiris/actions-gh-pages@v3 - if: github.ref == 'refs/heads/master' - with: - github_token: ${{secrets.GITHUB_TOKEN}} - publish_branch: gh-pages - publish_dir: ./www diff --git a/src/subcommand/torrent/create.rs b/src/subcommand/torrent/create.rs index f766893..a611eb4 100644 --- a/src/subcommand/torrent/create.rs +++ b/src/subcommand/torrent/create.rs @@ -1809,10 +1809,8 @@ Content Size 9 bytes fn populate_symlinks(env: &Env) { let dir = env.resolve("foo"); let file_src = env.resolve("bar"); - let file_link = env.resolve("foo/bar"); let dir_src = env.resolve("dir-src"); let dir_contents = dir_src.join("baz"); - let dir_link = env.resolve("foo/dir"); fs::create_dir(&dir_src).unwrap(); fs::write(dir_contents, "baz").unwrap(); @@ -1820,6 +1818,8 @@ Content Size 9 bytes fs::write(file_src, "bar").unwrap(); #[cfg(unix)] { + let file_link = env.resolve("foo/bar"); + let dir_link = env.resolve("foo/dir"); Command::new("ln") .arg("-s") .arg("../bar") diff --git a/src/test_env.rs b/src/test_env.rs index b3b2cc8..e481bfc 100644 --- a/src/test_env.rs +++ b/src/test_env.rs @@ -67,10 +67,12 @@ impl TestEnv { fs::create_dir(self.env.resolve(path)).unwrap(); } + #[cfg(unix)] pub(crate) fn metadata(&self, path: impl AsRef) -> fs::Metadata { fs::metadata(self.env.resolve(path)).unwrap() } + #[cfg(unix)] pub(crate) fn set_permissions(&self, path: impl AsRef, permissions: fs::Permissions) { fs::set_permissions(self.env.resolve(path), permissions).unwrap(); }