Skip to content

Commit 6a1a9ed

Browse files
committed
Merge branch 'homemerge' into lucio/home-crate
2 parents 0409e39 + dbb8dad commit 6a1a9ed

File tree

13 files changed

+907
-0
lines changed

13 files changed

+907
-0
lines changed
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
on:
2+
push:
3+
branches: [main]
4+
pull_request:
5+
name: check
6+
jobs:
7+
fmt:
8+
runs-on: ubuntu-latest
9+
name: stable / fmt
10+
steps:
11+
- uses: actions/checkout@v3
12+
with:
13+
submodules: true
14+
- name: Install stable
15+
uses: actions-rs/toolchain@v1
16+
with:
17+
profile: minimal
18+
toolchain: stable
19+
components: rustfmt
20+
- name: cargo fmt --check
21+
uses: actions-rs/cargo@v1
22+
with:
23+
command: fmt
24+
args: --check
25+
clippy:
26+
runs-on: ubuntu-latest
27+
name: ${{ matrix.toolchain }} / clippy
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
toolchain: [stable, beta]
32+
steps:
33+
- uses: actions/checkout@v3
34+
with:
35+
submodules: true
36+
- name: Install ${{ matrix.toolchain }}
37+
uses: actions-rs/toolchain@v1
38+
with:
39+
profile: minimal
40+
toolchain: ${{ matrix.toolchain }}
41+
default: true
42+
components: clippy
43+
- name: cargo clippy
44+
uses: actions-rs/clippy-check@v1
45+
with:
46+
token: ${{ secrets.GITHUB_TOKEN }}
47+
doc:
48+
runs-on: ubuntu-latest
49+
name: nightly / doc
50+
steps:
51+
- uses: actions/checkout@v3
52+
with:
53+
submodules: true
54+
- name: Install nightly
55+
uses: actions-rs/toolchain@v1
56+
with:
57+
profile: minimal
58+
toolchain: nightly
59+
default: true
60+
- name: cargo doc
61+
uses: actions-rs/cargo@v1
62+
with:
63+
command: doc
64+
args: --no-deps --all-features
65+
env:
66+
RUSTDOCFLAGS: --cfg docsrs
67+
hack:
68+
runs-on: ubuntu-latest
69+
name: ubuntu / stable / features
70+
steps:
71+
- uses: actions/checkout@v3
72+
with:
73+
submodules: true
74+
- name: Install stable
75+
uses: actions-rs/toolchain@v1
76+
with:
77+
profile: minimal
78+
toolchain: stable
79+
- name: cargo install cargo-hack
80+
uses: taiki-e/install-action@cargo-hack
81+
- name: cargo hack
82+
uses: actions-rs/cargo@v1
83+
with:
84+
command: hack
85+
args: --feature-powerset check --lib --tests
86+
msrv:
87+
runs-on: ubuntu-latest
88+
# we use a matrix here just because env can't be used in job names
89+
# https://docs.github.com/en/actions/learn-github-actions/contexts#context-availability
90+
strategy:
91+
matrix:
92+
msrv: [1.36.0]
93+
name: ubuntu / ${{ matrix.msrv }}
94+
steps:
95+
- uses: actions/checkout@v3
96+
with:
97+
submodules: true
98+
- name: Install ${{ matrix.toolchain }}
99+
uses: actions-rs/toolchain@v1
100+
with:
101+
profile: minimal
102+
toolchain: ${{ matrix.msrv }}
103+
default: true
104+
- name: cargo +${{ matrix.msrv }} check
105+
uses: actions-rs/cargo@v1
106+
with:
107+
command: check
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
on:
2+
push:
3+
branches: [main]
4+
pull_request:
5+
schedule:
6+
- cron: '7 7 * * *'
7+
name: rolling
8+
jobs:
9+
# https://twitter.com/mycoliza/status/1571295690063753218
10+
nightly:
11+
runs-on: ubuntu-latest
12+
name: ubuntu / nightly
13+
steps:
14+
- uses: actions/checkout@v3
15+
with:
16+
submodules: true
17+
- name: Install nightly
18+
uses: actions-rs/toolchain@v1
19+
with:
20+
profile: minimal
21+
toolchain: nightly
22+
default: true
23+
- name: cargo generate-lockfile
24+
if: hashFiles('Cargo.lock') == ''
25+
uses: actions-rs/cargo@v1
26+
with:
27+
command: generate-lockfile
28+
- name: cargo test --locked
29+
uses: actions-rs/cargo@v1
30+
with:
31+
command: test
32+
args: --locked --all-features --all-targets
33+
# https://twitter.com/alcuadrado/status/1571291687837732873
34+
update:
35+
runs-on: ubuntu-latest
36+
name: ubuntu / beta / updated
37+
# There's no point running this if no Cargo.lock was checked in in the
38+
# first place, since we'd just redo what happened in the regular test job.
39+
# Unfortunately, hashFiles only works in if on steps, so we reepeat it.
40+
# if: hashFiles('Cargo.lock') != ''
41+
steps:
42+
- uses: actions/checkout@v3
43+
with:
44+
submodules: true
45+
- name: Install beta
46+
if: hashFiles('Cargo.lock') != ''
47+
uses: actions-rs/toolchain@v1
48+
with:
49+
profile: minimal
50+
toolchain: beta
51+
default: true
52+
- name: cargo update
53+
if: hashFiles('Cargo.lock') != ''
54+
uses: actions-rs/cargo@v1
55+
with:
56+
command: update
57+
- name: cargo test
58+
if: hashFiles('Cargo.lock') != ''
59+
uses: actions-rs/cargo@v1
60+
with:
61+
command: test
62+
args: --locked --all-features --all-targets
63+
env:
64+
RUSTFLAGS: -D deprecated
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
on:
2+
push:
3+
branches: [main]
4+
pull_request:
5+
name: test
6+
jobs:
7+
required:
8+
runs-on: ubuntu-latest
9+
name: ubuntu / ${{ matrix.toolchain }}
10+
strategy:
11+
matrix:
12+
toolchain: [stable, beta]
13+
steps:
14+
- uses: actions/checkout@v3
15+
with:
16+
submodules: true
17+
- name: Install ${{ matrix.toolchain }}
18+
uses: actions-rs/toolchain@v1
19+
with:
20+
profile: minimal
21+
toolchain: ${{ matrix.toolchain }}
22+
default: true
23+
- name: cargo generate-lockfile
24+
if: hashFiles('Cargo.lock') == ''
25+
uses: actions-rs/cargo@v1
26+
with:
27+
command: generate-lockfile
28+
# https://twitter.com/jonhoo/status/1571290371124260865
29+
- name: cargo test --locked
30+
uses: actions-rs/cargo@v1
31+
with:
32+
command: test
33+
args: --locked --all-features --all-targets
34+
minimal:
35+
runs-on: ubuntu-latest
36+
name: ubuntu / stable / minimal-versions
37+
steps:
38+
- uses: actions/checkout@v3
39+
with:
40+
submodules: true
41+
- name: Install stable
42+
uses: actions-rs/toolchain@v1
43+
with:
44+
profile: minimal
45+
toolchain: stable
46+
- name: Install nightly for -Zminimal-versions
47+
uses: actions-rs/toolchain@v1
48+
with:
49+
profile: minimal
50+
toolchain: nightly
51+
- name: cargo update -Zminimal-versions
52+
uses: actions-rs/cargo@v1
53+
with:
54+
command: update
55+
toolchain: nightly
56+
args: -Zminimal-versions
57+
- name: cargo test
58+
uses: actions-rs/cargo@v1
59+
with:
60+
command: test
61+
args: --locked --all-features --all-targets
62+
os-check:
63+
runs-on: ${{ matrix.os }}
64+
name: ${{ matrix.os }} / stable
65+
strategy:
66+
fail-fast: false
67+
matrix:
68+
os: [macos-latest, windows-latest]
69+
steps:
70+
- uses: actions/checkout@v3
71+
with:
72+
submodules: true
73+
- name: Install stable
74+
uses: actions-rs/toolchain@v1
75+
with:
76+
profile: minimal
77+
toolchain: stable
78+
- name: cargo generate-lockfile
79+
if: hashFiles('Cargo.lock') == ''
80+
uses: actions-rs/cargo@v1
81+
with:
82+
command: generate-lockfile
83+
- name: cargo test
84+
uses: actions-rs/cargo@v1
85+
with:
86+
command: test
87+
args: --locked --all-features --all-targets

crates/home/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
target/
2+
Cargo.lock

crates/home/.rustfmt.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
max_width = 120
2+
edition = "2018"
3+
merge_derives = false
4+
use_field_init_shorthand = true

crates/home/CHANGELOG.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
<!-- ## [Unreleased] -->
8+
9+
## [0.5.4] - 2022-10-10
10+
- Add `_with_env` variants of functions to support in-process threaded tests for
11+
rustup.
12+
13+
## [0.5.3] - 2020-01-07
14+
15+
Use Rust 1.36.0 as minimum Rust version.
16+
17+
## [0.5.2] - 2020-01-05
18+
19+
*YANKED since it cannot be built on Rust 1.36.0*
20+
21+
### Changed
22+
- Check for emptiness of `CARGO_HOME` and `RUSTUP_HOME` environment variables.
23+
- Windows: Use `SHGetFolderPath` to replace `GetUserProfileDirectory` syscall.
24+
* Remove `scopeguard` dependency.
25+
26+
## [0.5.1] - 2019-10-12
27+
### Changed
28+
- Disable unnecessary features for `scopeguard`. Thanks @mati865.
29+
30+
## [0.5.0] - 2019-08-21
31+
### Added
32+
- Add `home_dir` implementation for Windows UWP platforms.
33+
34+
### Fixed
35+
- Fix `rustup_home` implementation when `RUSTUP_HOME` is an absolute directory.
36+
- Fix `cargo_home` implementation when `CARGO_HOME` is an absolute directory.
37+
38+
### Removed
39+
- Remove support for `multirust` folder used in old version of `rustup`.
40+
41+
[Unreleased]: https://github.com/brson/home/compare/v0.5.4...HEAD
42+
[0.5.4]: https://github.com/brson/home/compare/v0.5.3...v0.5.4
43+
[0.5.3]: https://github.com/brson/home/compare/v0.5.2...v0.5.3
44+
[0.5.2]: https://github.com/brson/home/compare/v0.5.1...v0.5.2
45+
[0.5.1]: https://github.com/brson/home/compare/v0.5.0...v0.5.1
46+
[0.5.0]: https://github.com/brson/home/compare/0.4.2...v0.5.0

crates/home/Cargo.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[package]
2+
name = "home"
3+
version = "0.5.4" # also update `html_root_url` in `src/lib.rs`
4+
authors = [ "Brian Anderson <[email protected]>" ]
5+
documentation = "https://docs.rs/home"
6+
edition = "2018"
7+
include = [
8+
"/src",
9+
"/Cargo.toml",
10+
"/CHANGELOG",
11+
"/LICENSE-*",
12+
"/README.md",
13+
]
14+
license = "MIT OR Apache-2.0"
15+
readme = "README.md"
16+
repository = "https://github.com/brson/home"
17+
description = "Shared definitions of home directories"
18+
19+
[target."cfg(windows)".dependencies.winapi]
20+
version = "0.3"
21+
features = [
22+
"shlobj",
23+
"std",
24+
"winerror",
25+
]

0 commit comments

Comments
 (0)