added check #114
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: Tests | |
on: | |
push: | |
jobs: | |
smoke-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Create list.txt | |
run: echo "OSLL/github_repo_commitment_calc" > list.txt | |
- name: Install dependencies | |
run: pip install -r requirements.txt | |
- name: Run test | |
run: python3 main.py --commits --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: Check header in first line | |
run: | | |
HEADER="repository name,author name,author login,author email,date and time,changed files,commit id,branch" | |
FIRST_LINE=$(head -n 1 out.csv) | |
if [[ "$FIRST_LINE" == "$HEADER"* ]]; then | |
echo "Header is valid" | |
else | |
echo "Header is invalid" | |
exit 1 | |
fi | |
- name: Upload test results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-results | |
path: out.csv |