Skip to content

Commit a53341f

Browse files
authored
Merge pull request #15 from UMM-CSci-Systems/update-workflows
Update GitHub Actions workflows and related documentation in the README
2 parents 5f3b312 + ca388e7 commit a53341f

File tree

5 files changed

+21
-14
lines changed

5 files changed

+21
-14
lines changed

.github/workflows/arraymerge_gtest.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ on:
1111
paths:
1212
- 'array_merge/**'
1313
- 'mergesort/mergesort.[ch]'
14+
- '.github/workflows/**'
1415
workflow_dispatch:
1516

1617
jobs:
1718
build:
1819
runs-on: ubuntu-latest
1920
steps:
2021
- name: Cache gtest library
21-
uses: actions/cache@v2
22+
uses: actions/cache@v4
2223
env:
2324
cache-name: cache-gtest-lib
2425
with:
@@ -33,7 +34,7 @@ jobs:
3334
- name: Check out the code
3435
uses: actions/checkout@v2
3536
- name: Compile test code
36-
run: g++ -Wall -g -o array_merge_test ../mergesort/mergesort.c array_merge.c array_merge_test.cpp -lgtest -pthread -std=c++0x
37+
run: g++ -Wall -g -o array_merge_test ../mergesort/mergesort.c array_merge.c array_merge_test.cpp -lgtest -pthread -std=c++14
3738
working-directory: array_merge
3839
- name: Run test
3940
run: ./array_merge_test

.github/workflows/arraymerge_test_valgrind.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@ on:
1111
paths:
1212
- 'array_merge/**'
1313
- 'mergesort/mergesort.[ch]'
14+
- '.github/workflows/**'
1415
workflow_dispatch:
1516

1617
jobs:
1718
build:
1819
runs-on: ubuntu-latest
1920
steps:
2021
- name: Cache gtest library
21-
uses: actions/cache@v2
22+
uses: actions/cache@v4
2223
env:
2324
cache-name: cache-gtest-lib
2425
with:
@@ -35,7 +36,7 @@ jobs:
3536
- name: Check out the code
3637
uses: actions/checkout@v2
3738
- name: Compile code
38-
run: g++ -Wall -g -o array_merge_test ../mergesort/mergesort.c array_merge.c array_merge_test.cpp -lgtest -pthread -std=c++0x
39+
run: g++ -Wall -g -o array_merge_test ../mergesort/mergesort.c array_merge.c array_merge_test.cpp -lgtest -pthread -std=c++14
3940
working-directory: array_merge
4041
- name: Run test
4142
run: valgrind -v --leak-check=full --show-leak-kinds=all --error-exitcode=1 ./array_merge_test

.github/workflows/mergesort_gtest.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ on:
88
push:
99
paths:
1010
- 'mergesort/**'
11+
- '.github/workflows/mergesort_gtest.yml'
12+
- '.github/workflows/mergesort_test_valgrind.yml'
1113
workflow_dispatch:
1214

1315
jobs:
1416
build:
1517
runs-on: ubuntu-latest
1618
steps:
1719
- name: Cache gtest library
18-
uses: actions/cache@v2
20+
uses: actions/cache@v4
1921
env:
2022
cache-name: cache-gtest-lib
2123
with:
@@ -30,7 +32,7 @@ jobs:
3032
- name: Check out the code
3133
uses: actions/checkout@v2
3234
- name: Compile test code
33-
run: g++ -Wall -g -o mergesort_test mergesort.c mergesort_test.cpp -lgtest -pthread -std=c++0x
35+
run: g++ -Wall -g -o mergesort_test mergesort.c mergesort_test.cpp -lgtest -pthread -std=c++14
3436
working-directory: mergesort
3537
- name: Run test
3638
run: ./mergesort_test

.github/workflows/mergesort_test_valgrind.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ on:
88
push:
99
paths:
1010
- 'mergesort/**'
11+
- '.github/workflows/mergesort_gtest.yml'
12+
- '.github/workflows/mergesort_test_valgrind.yml'
1113
workflow_dispatch:
1214

1315
jobs:
1416
build:
1517
runs-on: ubuntu-latest
1618
steps:
1719
- name: Cache gtest library
18-
uses: actions/cache@v2
20+
uses: actions/cache@v4
1921
env:
2022
cache-name: cache-gtest-lib
2123
with:
@@ -32,7 +34,7 @@ jobs:
3234
- name: Check out the code
3335
uses: actions/checkout@v2
3436
- name: Compile code
35-
run: g++ -Wall -g -o mergesort_test mergesort.c mergesort_test.cpp -lgtest -pthread -std=c++0x
37+
run: g++ -Wall -g -o mergesort_test mergesort.c mergesort_test.cpp -lgtest -pthread -std=c++14
3638
working-directory: mergesort
3739
- name: Run test
3840
run: valgrind -v --leak-check=full --show-leak-kinds=all --error-exitcode=1 ./mergesort_test

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ the implementation of the function listed in `foo.h`.
9999
To compile the test code use the following:
100100

101101
```bash
102-
g++ -Wall -g -o foo_test foo.c foo_test.cpp -lgtest -pthread -std=c++0x
102+
g++ -Wall -g -o foo_test foo.c foo_test.cpp -lgtest -pthread -std=c++14
103103
```
104104

105105
*Notice that this uses `g++` instead of `gcc`.* This because the `gtest`
@@ -110,7 +110,8 @@ the executable, however, which can be *extremely* helpful when using
110110
tools like `valgrind` or the `gdb` debugger. If you don't include it,
111111
for example, then those tools won't be able to report accurate or useful
112112
line numbers or function names. The `-lgtest` tells the compiler to include
113-
the `gtest` library (that's the `-l` part) when generating the executable.
113+
the `gtest` library (that's the `-l` part) when generating the executable
114+
`foo_test`, which you can run using `./foo_test`.
114115

115116
---
116117

@@ -238,10 +239,10 @@ You can use references like `../mergesort/mergesort.h` or
238239
`../mergesort/mergesort.c` to access appropriate files in that part of
239240
the project, either in things like `#include` statements or
240241
in `gcc/g++` calls. The command in the GitHub Actions to compile
241-
the Array Merge tess, for example, is:
242+
the Array Merge tests, for example, is:
242243

243244
```text
244-
g++ -Wall -g -o array_merge_test ../mergesort/mergesort.c array_merge.c array_merge_test.cpp -lgtest -pthread -std=c++0x
245+
g++ -Wall -g -o array_merge_test ../mergesort/mergesort.c array_merge.c array_merge_test.cpp -lgtest -pthread -std=c++14
245246
```
246247

247248
Note that the `../mergesort/mergesort.c` in this command includes
@@ -258,6 +259,6 @@ That has two major implications:
258259

259260
Be sure that:
260261

261-
- [ ] You follow our instructions
262+
- [ ] You follow our instructions (especially about how we want you to be using `malloc` or `calloc` instead of leveraging the dynamically allocated memory option)
262263
- [ ] Your canvas group matches your github classroom group
263-
- [ ] You submit your repository URL to canvas (if your canvas groups are set up correctly this will only need to be done once)
264+
- [ ] You submit your repository URL to canvas (if your canvas groups are set up correctly this will only need to be done by one team member)

0 commit comments

Comments
 (0)