Shared_ptr basic impl #440
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: shared_ptr_homework | |
on: [push, pull_request] | |
jobs: | |
files_check: | |
runs-on: ubuntu-latest | |
outputs: | |
shared_ptr_exists: ${{ steps.shared_ptr.outputs.files_exists }} | |
weak_ptr_exists: ${{ steps.weak_ptr.outputs.files_exists }} | |
make_shared_exists: ${{ steps.make_shared.outputs.files_exists }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Check shared_ptr.hpp file existence | |
id: shared_ptr | |
uses: andstor/file-existence-action@v1 | |
with: | |
files: "homework/shared_ptr/shared_ptr.hpp" | |
- name: Check weak_ptr.hpp file existence | |
id: weak_ptr | |
uses: andstor/file-existence-action@v1 | |
with: | |
files: "homework/shared_ptr/weak_ptr.hpp" | |
- name: Check make_shared.hpp file existence | |
id: make_shared | |
uses: andstor/file-existence-action@v1 | |
with: | |
files: "homework/shared_ptr/make_shared.hpp" | |
shared_ptr: | |
needs: files_check | |
if: needs.files_check.outputs.shared_ptr_exists == 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Run tests and sanitizer | |
uses: coders-school/github-actions/run-tests@main | |
with: | |
task_name: 'shared_ptr' | |
test_file: '../tests/shared_ptr_tests.cpp' | |
weak_ptr: | |
needs: files_check | |
if: needs.files_check.outputs.weak_ptr_exists == 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Run tests and sanitizer | |
uses: coders-school/github-actions/run-tests@main | |
with: | |
task_name: 'weak_ptr' | |
test_file: '../tests/weak_ptr_tests.cpp' | |
make_shared: | |
needs: files_check | |
if: needs.files_check.outputs.make_shared_exists == 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Run tests and sanitizer | |
uses: coders-school/github-actions/run-tests@main | |
with: | |
task_name: 'make_shared' | |
test_file: '../tests/make_shared_tests.cpp' | |
shared_ptr_formatting_check: | |
needs: files_check | |
if: needs.files_check.outputs.shared_ptr_exists == 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Run clang-format style check | |
uses: coders-school/github-actions/clang-format-check@main | |
with: | |
check_path: 'homework/shared_ptr' | |
shared_ptr_students_tests: | |
needs: files_check | |
if: needs.files_check.outputs.shared_ptr_exists == 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Run tests and sanitizer | |
uses: coders-school/github-actions/run-tests@main | |
with: | |
task_name: 'shared_ptr' | |
test_file: '../../../homework/shared_ptr/shared_ptr_tests.cpp' | |
test_to_run: 'shared_ptr_student' | |
weak_ptr_students_tests: | |
needs: files_check | |
if: needs.files_check.outputs.weak_ptr_exists == 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Run tests and sanitizer | |
uses: coders-school/github-actions/run-tests@main | |
with: | |
task_name: 'weak_ptr' | |
test_file: '../../../homework/shared_ptr/weak_ptr_tests.cpp' | |
test_to_run: 'weak_ptr_student' | |
make_shared_students_tests: | |
needs: files_check | |
if: needs.files_check.outputs.make_shared_exists == 'true' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Run tests and sanitizer | |
uses: coders-school/github-actions/run-tests@main | |
with: | |
task_name: 'make_shared' | |
test_file: '../../../homework/shared_ptr/make_shared_tests.cpp' | |
test_to_run: 'make_shared_student' | |
check_shared_ptr_interface: | |
needs: shared_ptr_formatting_check | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Check shared_ptr has whole interface implemented | |
working-directory: .github/scripts | |
run: ./shared_ptr_interface_check.sh | |
shared_ptr_coverage: | |
needs: shared_ptr_students_tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: coders-school/github-actions/coverage-check@main | |
with: | |
task_name: 'shared_ptr' | |
test_file: '../../../homework/shared_ptr/shared_ptr_tests.cpp' | |
test_to_run: 'shared_ptr_student' | |
lcov_file: 'shared_ptr.hpp' | |
template_pattern: 'template\s*class\s*my::shared_ptr<\s*\w+\s*>' |