From 7c6685e0364ac9f9e8ba0c3ca478bc3c569270f8 Mon Sep 17 00:00:00 2001 From: Devon Friend <69879126+DFriend01@users.noreply.github.com> Date: Sat, 9 Sep 2023 20:34:59 -0700 Subject: [PATCH] Update README.md (#8) * Update README.md * Update README.md * Implement hidden tests a different way --------- Co-authored-by: Patrick Creighton --- .github/workflows/c-cpp-hidden.yml | 26 -------------------------- .github/workflows/hidden-tests.yml | 17 +++++++---------- .github/workflows/python-hidden.yml | 26 -------------------------- README.md | 11 +++++------ 4 files changed, 12 insertions(+), 68 deletions(-) delete mode 100644 .github/workflows/c-cpp-hidden.yml delete mode 100644 .github/workflows/python-hidden.yml diff --git a/.github/workflows/c-cpp-hidden.yml b/.github/workflows/c-cpp-hidden.yml deleted file mode 100644 index 6165367..0000000 --- a/.github/workflows/c-cpp-hidden.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: C/C++ Solution Tests - -on: - workflow_dispatch: - -jobs: - tests-prereq: - name: Tests Prerequisites Check - runs-on: ubuntu-latest - steps: - - name: Check if secrets.GH_TOKEN is set - run: | - if [ -z "${{ secrets.GH_TOKEN }}" ]; then - echo "GH_TOKEN is not set, ask your email contact to add it for you" - exit 1 - fi - - tests: - name: Solution Tests (Output Hidden) - uses: UBCSailbot/software-quiz/.github/workflows/hidden-tests.yml@master - needs: [tests-prereq] - with: - repository: ${{ github.repository }} - cutest: true - secrets: - token: ${{ secrets.GH_TOKEN }} diff --git a/.github/workflows/hidden-tests.yml b/.github/workflows/hidden-tests.yml index 6984091..8efd4bd 100644 --- a/.github/workflows/hidden-tests.yml +++ b/.github/workflows/hidden-tests.yml @@ -1,26 +1,23 @@ name: Hidden Tests on: - workflow_call: + workflow_dispatch: inputs: - # The repository name: ${{ github.repository }} repository: + description: '/' + default: 'UBCSailbot/software-quiz' required: true type: string - # Run C/C++ tests cutest: + description: 'check to run cutest' default: false required: false type: boolean - # Run python tests pytest: + description: 'check to run pytest' default: false required: false type: boolean - secrets: - # Token to access solutions repository - token: - required: false jobs: cutest: @@ -39,7 +36,7 @@ jobs: with: path: 'sol' repository: 'UBCSailbot/software-quiz-sample-solution' - token: ${{ secrets.token }} + token: ${{ secrets.GH_TOKEN }} - name: Copy solutions to src run: cp sol/c-cpp/test_standard_calc.cpp src/c-cpp @@ -66,7 +63,7 @@ jobs: with: path: 'sol' repository: 'UBCSailbot/software-quiz-sample-solution' - token: ${{ secrets.token }} + token: ${{ secrets.GH_TOKEN }} - name: Copy solutions to src run: cp sol/python/test_standard_calc.py src/python diff --git a/.github/workflows/python-hidden.yml b/.github/workflows/python-hidden.yml deleted file mode 100644 index 56fcd34..0000000 --- a/.github/workflows/python-hidden.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Python Solution Tests - -on: - workflow_dispatch: - -jobs: - tests-prereq: - name: Tests Prerequisites Check - runs-on: ubuntu-latest - steps: - - name: Check if secrets.GH_TOKEN is defined - run: | - if [ -z "${{ secrets.GH_TOKEN }}" ]; then - echo "GH_TOKEN is not set, ask your email contact to add it for you" - exit 1 - fi - - tests: - name: Solution Tests (Output Hidden) - uses: UBCSailbot/software-quiz/.github/workflows/hidden-tests.yml@master - needs: [tests-prereq] - with: - repository: ${{ github.repository }} - pytest: true - secrets: - token: ${{ secrets.GH_TOKEN }} diff --git a/README.md b/README.md index 4adc9fa..4eb95de 100644 --- a/README.md +++ b/README.md @@ -32,17 +32,16 @@ You may use any resources you find, but must complete the quiz individually. Goo 1. Complete the functions in `c-cpp/standard_calc.cpp` 2. Add unit tests in `c-cpp/test_standard_calc.cpp` to verify your implementations * See the [C/C++ Notes](#cc-notes) section below for more details -3. *Bonus (Optional)*: pass the continuous integration tests on GitHub +3. Pass the continuous integration tests on GitHub *(Optional)* - Python: runs `flake8 . --count --max-complexity=10 --max-line-length=127 --statistics` and `pytest` successfully - `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 - 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). - - Hidden tests - - Enable by asking your email contact to add the required repository secret - - Run Python solution tests [here](https://github.com/UBCSailbot/software-quiz/actions/workflows/python-hidden.yml) and C/C++ solution tests [here](https://github.com/UBCSailbot/software-quiz/actions/workflows/c-cpp-hidden.yml) - - Once the repository secret has been added, the Tests Prerequisites Check job should pass -4. Submit the completed quiz +4. Hidden tests: You can test your solution against our hidden tests *(Optional)* + - In the [template repository's Hidden Tests action](https://github.com/UBCSailbot/software-quiz/actions/workflows/hidden-tests.yml), + click **Run workflow**, enter your repository identifier, select the hidden tests you want to run, then click **Run workflow** +5. Submit the completed quiz - GitHub: send us the link to your repository, ensuring that it is public - ZIP file: zip the quiz and send it to us