我正在尝试在GitHubActions中获取覆盖率报告但是我给了我这个错误

我正在尝试在 GitHub Actions 中获取覆盖率报告

但是当我运行管道时,我给了我这个错误

Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock

然后我搜索添加添加了 sudo mysql start 服务,现在我得到这个错误,但我不知道是否必须写 mit -root -password 和 -host?

Access denied for user 'root'@'localhost' (using password: YES)")

我该怎么做?

name: Django CI
on:
  push:
    branches: [ unittests ]
    paths-ignore: '**/SkoleProtocol/attendanceCode/tests/test_selenium.py'
  pull_request:
    branches: [ unittests ]
jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      max-parallel: 4
      matrix:
        python-version: [3.7, 3.8, 3.9]
    steps:
    - uses: actions/checkout@v2
    - name: Set up Python 3.7
      uses: actions/setup-python@v2
      with:
        python-version: 3.7
    - name: Install dependencies
      run: |
        python -m pip install --upgrade pip
        pip install -r requirements.txt
    - name: Create test database
      run: |
        sudo service mysql start
    - name: Coverage report
      run: |
        pip install coverage
        coverage run manage.py test
        coverage report
    - name: Lint with flake8
      run: |
        pip install flake8
        flake8 ./attendanceCode --exit-zero # Exit with status code "0" even if there are errors.
    - name: Django Tests
      run: |
        python3 manage.py test

© 版权声明
THE END
喜欢就支持一下吧
点赞234 分享
评论 抢沙发
头像
欢迎您留下宝贵的见解!
提交
头像

昵称

取消
昵称表情代码图片