Skip to content

Commit 8ff213d

Browse files
authored
Merge pull request #195 from rage/newflow
Fix workflow
2 parents 091b240 + 298cc98 commit 8ff213d

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

.github/workflows/test.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,25 @@ jobs:
2020
runs-on: ${{ matrix.os }}
2121

2222
steps:
23-
- uses: actions/checkout@v2
23+
- name: Checkout
24+
uses: actions/checkout@v2
2425
- name: Install Rust
2526
uses: actions-rs/toolchain@v1
2627
with:
2728
profile: minimal
2829
toolchain: stable
2930
components: rustfmt, clippy
30-
- uses: Swatinem/rust-cache@v1
31+
- name: Cache
32+
uses: Swatinem/rust-cache@v1
3133

3234
- name: Diagnostics on Windows
3335
if: matrix.os == 'windows-latest'
3436
run: "gci env:"
3537

3638
- name: Rustfmt
37-
uses: actions/checkout@v2
3839
run: cargo fmt -- --check
39-
4040
- name: Clippy
41+
if: matrix.os == 'ubuntu-latest'
4142
uses: actions-rs/clippy-check@v1
4243
with:
4344
token: ${{ secrets.GITHUB_TOKEN }}
@@ -46,25 +47,30 @@ jobs:
4647
- name: Build test binary
4748
run: cargo test --no-run
4849

49-
- name: Install depedencies
50+
- name: Install dependencies
5051
if: matrix.os == 'ubuntu-latest'
5152
run: |
5253
sudo apt update -y
5354
sudo apt install -y check valgrind # required for make plugin
5455
sudo apt install -y libcurl4-gnutls-dev libgit2-dev # required for R
56+
5557
- name: Install Node
5658
uses: actions/setup-node@v2
5759
with:
5860
node-version: "16"
61+
5962
- name: Install C#
6063
uses: actions/setup-dotnet@v1
6164
with:
6265
dotnet-version: "5.0.x"
63-
- name: Install tmc-r-tester
66+
67+
- name: Install R
6468
if: matrix.os == 'ubuntu-latest'
6569
uses: r-lib/actions/setup-r@v1
6670
with:
6771
r-version: "3.5.3"
72+
- name: Install tmc-r-tester
73+
if: matrix.os == 'ubuntu-latest'
6874
run: |
6975
Rscript -e 'install.packages(c("testthat", "jsonlite", "R.utils"))'
7076
Rscript -e 'install.packages("plugins/r/tests/tmcRtestrunner", repos=NULL, type="source")'

tmc-langs-util/src/file_util/lock_windows.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ mod test {
155155
let mutex = Arc::new(Mutex::new(vec![]));
156156

157157
// take file lock and then mutex
158-
let guard = lock.write().unwrap();
158+
let guard = lock.lock().unwrap();
159159
let mut mguard = mutex.try_lock().unwrap();
160160

161161
let handle = {
@@ -165,7 +165,7 @@ mod test {
165165
std::thread::spawn(move || {
166166
// if the file lock doesn't block, the mutex lock will panic and the test will fail
167167
let mut lock = FileLock::new(temp_path).unwrap();
168-
let _guard = lock.write().unwrap();
168+
let _guard = lock.lock().unwrap();
169169
mutex.try_lock().unwrap().push(1);
170170
})
171171
};
@@ -191,7 +191,7 @@ mod test {
191191
let mutex = Arc::new(Mutex::new(vec![]));
192192

193193
// take file lock and mutex
194-
let guard = lock.write().unwrap();
194+
let guard = lock.lock().unwrap();
195195
let mut mguard = mutex.try_lock().unwrap();
196196

197197
let handle = {
@@ -201,7 +201,7 @@ mod test {
201201
std::thread::spawn(move || {
202202
// if the file lock doesn't block, the mutex lock will panic and the test will fail
203203
let mut lock = FileLock::new(temp_path).unwrap();
204-
let _guard = lock.write().unwrap();
204+
let _guard = lock.lock().unwrap();
205205
mutex.try_lock().unwrap().push(1);
206206
})
207207
};
@@ -225,7 +225,7 @@ mod test {
225225
let mut lock = FileLock::new(temp.path().to_path_buf()).unwrap();
226226
let lock_path = temp.path().join(".tmc.lock");
227227
assert!(!lock_path.exists());
228-
let guard = lock.write().unwrap();
228+
let guard = lock.lock().unwrap();
229229
assert!(lock_path.exists());
230230
drop(guard);
231231
assert!(!lock_path.exists());

0 commit comments

Comments
 (0)