Skip to content

Commit

Permalink
ops(tests): run tests on aarch64, armv7 and x86_64 architectures
Browse files Browse the repository at this point in the history
Signed-off-by: Gaoyang Zhang <gy@blurgy.xyz>
  • Loading branch information
blurgyy committed Jan 31, 2022
1 parent 1cd8fc9 commit 4438386
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 6 deletions.
33 changes: 31 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,33 @@ name: tests
jobs:
unit-test:
runs-on: ubuntu-latest
strategy:
matrix:
build: [x86_64, armv7, aarch64]
include:
- build: x86_64
toolchain: stable
target: x86_64-unknown-linux-gnu
cross: false
strip_bin: strip
- build: armv7
toolchain: stable
target: armv7-unknown-linux-gnueabihf
cross: true
cross_helpers: gcc-arm-linux-gnueabihf binutils-arm-linux-gnueabihf
strip_bin: arm-linux-gnueabihf-strip
- build: aarch64
toolchain: stable
target: aarch64-unknown-linux-gnu
cross: true
cross_helpers: gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu
strip_bin: aarch64-linux-gnu-strip
steps:
- name: Install Linker
if: ${{ matrix.cross }}
run: |
sudo apt update
sudo apt install ${{ matrix.cross_helpers }}
- name: Checkout code
uses: actions/checkout@v2
with:
Expand All @@ -18,12 +44,15 @@ jobs:
- name: Setup rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
toolchain: ${{ matrix.toolchain }}
target: ${{ matrix.target }}
#override: true
- name: Run unit tests
uses: actions-rs/cargo@v1
with:
command: test
args: --all --all-features --locked
args: --all --all-features --locked --target ${{ matrix.target }}
use-cross: ${{ matrix.cross }}

# Author: Blurgy <gy@blurgy.xyz>
# Date: Oct 07 2021, 00:39 [CST]
28 changes: 24 additions & 4 deletions dt-core/src/syncing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,10 @@ target = "{}""#,
#[test]
fn target_readonly() -> Result<(), Report> {
// setup
let base = prepare_directory(
get_testroot().join("target_readonly").join("base"),
0o755,
)?;
let target_path = prepare_directory(
get_testroot()
.join("target_readonly")
Expand All @@ -554,9 +558,10 @@ target = "{}""#,
r#"
[[local]]
name = "target is readonly"
base = "~"
base = "{}"
sources = []
target = "{}""#,
base.display(),
target_path.display(),
))
.unwrap(),
Expand Down Expand Up @@ -586,6 +591,14 @@ target = "{}""#,
.join("staging-but-file"),
0o644,
)?;
let base = prepare_directory(
get_testroot().join("staging_is_file").join("base"),
0o755,
)?;
let target = prepare_directory(
get_testroot().join("staging_is_file").join("target"),
0o755,
)?;

if let Err(err) = expand(
DTConfig::from_str(&format!(
Expand All @@ -595,10 +608,12 @@ staging = "{}"
[[local]]
name = "staging is file"
base = "~"
base = "{}"
sources = []
target = ".""#,
target = "{}""#,
staging_path.display(),
base.display(),
target.display(),
))
.unwrap(),
) {
Expand Down Expand Up @@ -627,6 +642,10 @@ target = ".""#,
.join("staging-but-readonly"),
0o555,
)?;
let base = prepare_directory(
get_testroot().join("staging_readonly").join("base"),
0o755,
)?;
let target_path = prepare_directory(
get_testroot().join("staging_readonly").join("target"),
0o755,
Expand All @@ -640,10 +659,11 @@ staging = "{}"
[[local]]
name = "staging is readonly"
base = "~"
base = "{}"
sources = []
target = "{}""#,
staging_path.display(),
base.display(),
target_path.display(),
))
.unwrap(),
Expand Down

0 comments on commit 4438386

Please sign in to comment.