Merge Github Actions workflows

type: development
This commit is contained in:
Casey Rodarmor 2020-03-19 20:19:52 -07:00
parent 151d912156
commit 972a1ec628
No known key found for this signature in database
GPG Key ID: 556186B153EC6FE0
4 changed files with 21 additions and 33 deletions

View File

@ -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')

View File

@ -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

View File

@ -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")

View File

@ -67,10 +67,12 @@ impl TestEnv {
fs::create_dir(self.env.resolve(path)).unwrap();
}
#[cfg(unix)]
pub(crate) fn metadata(&self, path: impl AsRef<Path>) -> fs::Metadata {
fs::metadata(self.env.resolve(path)).unwrap()
}
#[cfg(unix)]
pub(crate) fn set_permissions(&self, path: impl AsRef<Path>, permissions: fs::Permissions) {
fs::set_permissions(self.env.resolve(path), permissions).unwrap();
}