Skip to content

Commit

Permalink
Use hidden tests (#5)
Browse files Browse the repository at this point in the history
* Use hidden tests

* Fix hidden tests workflow reference

* Remove hidden tests name

* Fix secrets reference

* Test update hidden tests CI

* Hardcode solutions repo reference

* Update secret name

* Try removing quotes

* Fix hidden tests

* Use different method of passing secrets

* Move hidden tests to separate workflows

* Fix workflow name
  • Loading branch information
patrick-5546 authored Sep 5, 2023
1 parent 93f2d1f commit a0c39a3
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 8 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/c-cpp-hidden.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: C/C++ Solution Tests

on:
workflow_dispatch:

jobs:
tests:
name: Solution Tests (Output Hidden)
uses: UBCSailbot/software-quiz/.github/workflows/hidden-tests.yml@patrick-5546/update-ci
with:
repository: ${{ github.repository }}
cutest: true
secrets:
token: ${{ secrets.GH_TOKEN }}
3 changes: 2 additions & 1 deletion .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ on:
pull_request:

jobs:
test:
tests:
name: Local Tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/hidden-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,14 @@ on:
default: false
required: false
type: boolean
secrets:
# Token to access solutions repository
token:
required: false

jobs:
cutest:
if: ${{ inputs.cutest }}
name: ${{ inputs.repository }} - C/C++ Hidden Tests
runs-on: ubuntu-latest
steps:
- name: Checkout src repository
Expand All @@ -35,8 +38,8 @@ jobs:
uses: actions/checkout@v4
with:
path: 'sol'
repository: '${{ github.repository }}'
token: '${{ secrets.token }}'
repository: 'UBCSailbot/software-quiz-sample-solution'
token: ${{ secrets.token }}

- name: Copy solutions to src
run: cp sol/c-cpp/test_standard_calc.cpp src/c-cpp
Expand All @@ -49,7 +52,6 @@ jobs:

pytest:
if: ${{ inputs.pytest }}
name: ${{ inputs.repository }} - Python Hidden Tests
runs-on: ubuntu-latest
steps:
- name: Checkout src repository
Expand All @@ -63,8 +65,8 @@ jobs:
uses: actions/checkout@v4
with:
path: 'sol'
repository: '${{ github.repository }}'
token: '${{ secrets.token }}'
repository: 'UBCSailbot/software-quiz-sample-solution'
token: ${{ secrets.token }}

- name: Copy solutions to src
run: cp sol/python/test_standard_calc.py src/python
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/python-hidden.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Python Solution Tests

on:
workflow_dispatch:

jobs:
tests:
name: Solution Tests (Output Hidden)
uses: UBCSailbot/software-quiz/.github/workflows/hidden-tests.yml@patrick-5546/update-ci
with:
repository: ${{ github.repository }}
pytest: true
secrets:
token: ${{ secrets.GH_TOKEN }}
3 changes: 2 additions & 1 deletion .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ on:
pull_request:

jobs:
test:
tests:
name: Local Tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ You may use any resources you find, but must complete the quiz individually. Goo
- `flake8` outputs 0 on success
- References that you may find helpful: [Flake8](https://flake8.pycqa.org/en/latest/), [PyTest](https://docs.pytest.org/en/6.2.x/getting-started.html)
- C/C++: runs `make` successfully
- Hidden Tests: Give your email contact access to your repository so that they can enable hidden tests
- You can find the results in the Actions tab on GitHub: [viewing your workflow results](https://docs.github.com/en/actions/quickstart#viewing-your-workflow-results).
4. Submit the completed quiz
- GitHub: send us the link to your repository, ensuring that it is public
Expand Down

0 comments on commit a0c39a3

Please sign in to comment.