Merge Github Actions workflows
type: development
This commit is contained in:
parent
151d912156
commit
972a1ec628
20
.github/workflows/build.yaml
vendored
20
.github/workflows/build.yaml
vendored
|
@ -27,6 +27,8 @@ jobs:
|
||||||
- os: windows-latest
|
- os: windows-latest
|
||||||
target: x86_64-pc-windows-msvc
|
target: x86_64-pc-windows-msvc
|
||||||
runs-on: ${{matrix.os}}
|
runs-on: ${{matrix.os}}
|
||||||
|
env:
|
||||||
|
RUSTFLAGS: "-D warnings"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Install Stable
|
- name: Install Stable
|
||||||
|
@ -43,8 +45,7 @@ jobs:
|
||||||
cargo --version
|
cargo --version
|
||||||
cargo clippy --version
|
cargo clippy --version
|
||||||
- name: Build
|
- name: Build
|
||||||
run: RUSTFLAGS="-D warnings" cargo build --all --verbose
|
run: cargo build --all --verbose
|
||||||
shell: bash
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: cargo test --all --verbose
|
run: cargo test --all --verbose
|
||||||
- name: Clippy
|
- name: Clippy
|
||||||
|
@ -66,11 +67,24 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
cargo run --package update-readme toc
|
cargo run --package update-readme toc
|
||||||
git diff --no-ext-diff --quiet --exit-code
|
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
|
- name: Package
|
||||||
id: package
|
id: package
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
run: ./bin/package ${{github.ref}} ${{matrix.os}} ${{matrix.target}}
|
|
||||||
shell: bash
|
shell: bash
|
||||||
|
run: ./bin/package ${{github.ref}} ${{matrix.os}} ${{matrix.target}}
|
||||||
- name: Publish
|
- name: Publish
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
|
|
28
.github/workflows/www.yaml
vendored
28
.github/workflows/www.yaml
vendored
|
@ -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
|
|
|
@ -1809,10 +1809,8 @@ Content Size 9 bytes
|
||||||
fn populate_symlinks(env: &Env) {
|
fn populate_symlinks(env: &Env) {
|
||||||
let dir = env.resolve("foo");
|
let dir = env.resolve("foo");
|
||||||
let file_src = env.resolve("bar");
|
let file_src = env.resolve("bar");
|
||||||
let file_link = env.resolve("foo/bar");
|
|
||||||
let dir_src = env.resolve("dir-src");
|
let dir_src = env.resolve("dir-src");
|
||||||
let dir_contents = dir_src.join("baz");
|
let dir_contents = dir_src.join("baz");
|
||||||
let dir_link = env.resolve("foo/dir");
|
|
||||||
fs::create_dir(&dir_src).unwrap();
|
fs::create_dir(&dir_src).unwrap();
|
||||||
fs::write(dir_contents, "baz").unwrap();
|
fs::write(dir_contents, "baz").unwrap();
|
||||||
|
|
||||||
|
@ -1820,6 +1818,8 @@ Content Size 9 bytes
|
||||||
fs::write(file_src, "bar").unwrap();
|
fs::write(file_src, "bar").unwrap();
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
{
|
{
|
||||||
|
let file_link = env.resolve("foo/bar");
|
||||||
|
let dir_link = env.resolve("foo/dir");
|
||||||
Command::new("ln")
|
Command::new("ln")
|
||||||
.arg("-s")
|
.arg("-s")
|
||||||
.arg("../bar")
|
.arg("../bar")
|
||||||
|
|
|
@ -67,10 +67,12 @@ impl TestEnv {
|
||||||
fs::create_dir(self.env.resolve(path)).unwrap();
|
fs::create_dir(self.env.resolve(path)).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(unix)]
|
||||||
pub(crate) fn metadata(&self, path: impl AsRef<Path>) -> fs::Metadata {
|
pub(crate) fn metadata(&self, path: impl AsRef<Path>) -> fs::Metadata {
|
||||||
fs::metadata(self.env.resolve(path)).unwrap()
|
fs::metadata(self.env.resolve(path)).unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(unix)]
|
||||||
pub(crate) fn set_permissions(&self, path: impl AsRef<Path>, permissions: fs::Permissions) {
|
pub(crate) fn set_permissions(&self, path: impl AsRef<Path>, permissions: fs::Permissions) {
|
||||||
fs::set_permissions(self.env.resolve(path), permissions).unwrap();
|
fs::set_permissions(self.env.resolve(path), permissions).unwrap();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user