Skip to content

Commit

Permalink
ci: make 'ssh localhost' work
Browse files Browse the repository at this point in the history
  • Loading branch information
eimrek committed Nov 8, 2023
1 parent f5441cc commit 3011e59
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 36 deletions.
73 changes: 37 additions & 36 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,19 @@ name: Continuous integration
on: [push, pull_request]

jobs:

pre-commit:

runs-on: ubuntu-latest
timeout-minutes: 5

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: "3.8"
- uses: pre-commit/[email protected]
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: "3.8"
- uses: pre-commit/[email protected]

tests:

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -30,30 +27,34 @@ jobs:
python-version: ["3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies (including dev dependencies at frozen version)
# I'm using pip install -e to make sure that the coverage properly traces the runs
# also of the concurrent tests (maybe we can achieve this differently)
run: |
python -m pip install --upgrade pip
pip install -e .[progressbar,optionaltests]
pip install -r requirements.lock
- name: Test with pytest
# No need to run the benchmarks, they will run in a different workflow
# Also, run in very verbose mode so if there is an error we get a complete diff
run: pytest -vv --cov=disk_objectstore --benchmark-skip
env:
SQLALCHEMY_WARN_20: 1
- name: Create xml coverage
run: coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml
name: disk-objectstore
## Commenting the following lines - if often fails, and if at least one manages to push, it should be enough
# fail_ci_if_error: true
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: set up 'ssh localhost'
run: |
.github/workflows/setup-ssh-localhost.sh
ssh localhost
- name: Install dependencies (including dev dependencies at frozen version)
# I'm using pip install -e to make sure that the coverage properly traces the runs
# also of the concurrent tests (maybe we can achieve this differently)
run: |
python -m pip install --upgrade pip
pip install -e .[progressbar,optionaltests]
pip install -r requirements.lock
- name: Test with pytest
# No need to run the benchmarks, they will run in a different workflow
# Also, run in very verbose mode so if there is an error we get a complete diff
run: pytest -vv --cov=disk_objectstore --benchmark-skip
env:
SQLALCHEMY_WARN_20: 1
- name: Create xml coverage
run: coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
files: ./coverage.xml
name: disk-objectstore
## Commenting the following lines - if often fails, and if at least one manages to push, it should be enough
# fail_ci_if_error: true
5 changes: 5 additions & 0 deletions .github/workflows/setup-ssh-localhost.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -ev

ssh-keygen -q -t rsa -b 4096 -N "" -f "${HOME}/.ssh/id_rsa"
ssh-keygen -y -f "${HOME}/.ssh/id_rsa" >> "${HOME}/.ssh/authorized_keys"

0 comments on commit 3011e59

Please sign in to comment.