f #116
Workflow file for this run
This file contains hidden or 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: Smoke Tests | |
| on: | |
| push: | |
| jobs: | |
| smoke-test: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| args: | |
| - "--invites" | |
| - "--commits" | |
| - "--pull_requests" | |
| - "--issues" | |
| - "--wikis" | |
| - "--contributors" | |
| - "--workflow_runs" | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Cache pip | |
| uses: actions/cache@v3 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| - name: Install dependencies | |
| run: pip install -r requirements.txt | |
| - name: Create list.txt | |
| run: echo "thehighestmath/SummerPractice" > list.txt | |
| - name: Run test | |
| run: | | |
| python3 main.py ${{ matrix.args }} --token ${{ secrets.TEST_TOKEN_GITHUB }} --list list.txt --out out.csv --branch master | |
| - name: Check if out.csv exists | |
| run: ls out.csv | |
| - name: Fail if out.csv does not exist | |
| if: failure() | |
| run: exit 1 | |
| - name: Show out.csv | |
| run: cat out.csv | |
| - name: Check header in first line | |
| run: | | |
| case "${{ matrix.args }}" in | |
| --invites) | |
| HEADER="repository name,author name,author login,author email,date and time,changed files,commit id,branch" | |
| ;; | |
| --commits) | |
| HEADER="repository name,author name,author login,author email,date and time,changed files,commit id,branch" | |
| ;; | |
| --pull_requests) | |
| HEADER="repository name,pull request number,title,state,author login,author email,date and time,merged,changed files,additions,deletions,commits,url,branch" | |
| ;; | |
| --issues) | |
| HEADER="repository name,issue number,title,state,author login,author email,date and time,url,branch" | |
| ;; | |
| --wikis) | |
| HEADER="repository name,wiki page title,author name,author login,author email,date and time,action,url,branch" | |
| ;; | |
| --contributors) | |
| HEADER="repository name,contributor login,number of commits,additions,deletions,branch" | |
| ;; | |
| --workflow_runs) | |
| HEADER="repository name,workflow name,run id,status,conclusion,author login,author email,date and time,url,branch" | |
| ;; | |
| *) | |
| echo "Unknown ARG: '${{ matrix.args }}'" | |
| exit 1 | |
| ;; | |
| esac | |
| FIRST_LINE=$(head -n 1 out.csv) | |
| if [[ "$FIRST_LINE" == "$HEADER"* ]]; then | |
| echo "Header is valid for ${{ matrix.args }}" | |
| else | |
| echo "::error::Header is invalid for ${{ matrix.args }}" | |
| echo "Expected: $HEADER" | |
| echo "Actual: $FIRST_LINE" | |
| exit 1 | |
| fi |