Skip to content

Commit 8614b5c

Browse files
committed
Fix workflow
1 parent 5f799cb commit 8614b5c

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

.github/workflows/test.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ jobs:
3838
- name: Rustfmt
3939
run: cargo fmt -- --check
4040
- name: Clippy
41+
if: matrix.os == 'ubuntu-latest'
4142
uses: actions-rs/clippy-check@v1
4243
with:
4344
token: ${{ secrets.GITHUB_TOKEN }}
@@ -46,26 +47,36 @@ 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"
66+
67+
- name: Cache R packages
68+
if: matrix.os == 'ubuntu-latest'
69+
uses: actions/cache@v1
70+
with:
71+
path: ${{ env.R_LIBS_USER }}
72+
key: r-${{ hashFiles('DESCRIPTION') }}
6373
- name: Install R
6474
if: matrix.os == 'ubuntu-latest'
6575
uses: r-lib/actions/setup-r@v1
6676
with:
6777
r-version: "3.5.3"
6878
- name: Install tmc-r-tester
79+
if: matrix.os == 'ubuntu-latest'
6980
run: |
7081
Rscript -e 'install.packages(c("testthat", "jsonlite", "R.utils"))'
7182
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)