Skip to content

CI

CI #94

Workflow file for this run

name: CI
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
# pull_request:
# branches: [ "main" ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.12
- name: Install Chrome
run: sudo apt-get install google-chrome-stable
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Run tests
run: |
pytest -s -vv --alluredir=allure-results
- name: Add allure information
working-directory: allure-results
if: always()
run: |
echo GIT_BRANCH=${{ github.head_ref || github.ref_name }} >> environment.properties
echo GIT_COMMIT_ID=${{ github.sha }} >> environment.properties
echo GIT_COMMIT_MESSAGE=$(git show -s --format=%s HEAD) >> environment.properties
echo GIT_COMMIT_AUTHOR_NAME=$(git show -s --format='%ae' HEAD) >> environment.properties
echo GIT_COMMIT_TIME=$(git show -s --format=%ci HEAD) >> environment.properties
echo CHROME_VERSION=$(google-chrome --product-version) >> environment.properties
- name: Checkout (copy) gh-pages repository to GitHub runner
uses: actions/checkout@v2
if: always()
with:
ref: gh-pages
path: gh-pages
- name: Copy history from gh-pages to allure-results
if: always()
run: |
sudo mkdir -p allure-results/history gh-pages/history
sudo cp -R gh-pages/history/* allure-results/history/
- name: Generate Allure report
if: always()
run: |
sudo docker-compose run regression /bin/sh -c "allure generate allure-results --clean -o allure-report"
# - name: Update Allure history
# if: always()
# run: |
# sudo cp -R allure-report/history/* gh-pages/history/
- name: Deploy to GitHub Pages
uses: JamesIves/github-pages-deploy-action@v4
if: always()
with:
token: ${{ secrets.CI_TOKEN }}
branch: gh-pages
folder: allure-report
# history dir: allure-history
#clean: true