-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #102 from grycap/devel
Move tests to actions
- Loading branch information
Showing
3 changed files
with
48 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Test IM-Client | ||
|
||
on: | ||
push: | ||
branches: ["master"] | ||
pull_request: | ||
branches: ["master"] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out the codebase. | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python 3. | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install dependencies | ||
run: python -m pip install coverage mock radl netaddr requests pycodestyle | ||
|
||
- name: Prepare auth.dat | ||
run: | | ||
cat <<EOT >> oidc-token | ||
#!/bin/sh | ||
echo "token" | ||
EOT | ||
chmod a+x oidc-token | ||
sed -i '/oidc-token/c\type = InfrastructureManager; bearer_token_command = '${GITHUB_WORKSPACE}'/oidc-token OIDC_ACCOUNT' auth.dat | ||
- name: Check code style | ||
run: pycodestyle --max-line-length=120 --ignore=E402,W605 . --exclude=doc | ||
|
||
- name: Unit tests | ||
run: python -m coverage run --source=. -m unittest discover -s test/unit -p '*.py' | ||
|
||
- name: Generate XML coverage report | ||
run: python -m coverage xml | ||
|
||
- name: Report coverage | ||
uses: codacy/codacy-coverage-reporter-action@v1 | ||
with: | ||
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} | ||
coverage-reports: coverage.xml |
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
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