From 132768be66ddd452653d28069c5825f035c80896 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kr=C3=B6ger?= Date: Mon, 11 Nov 2024 22:17:33 +0100 Subject: [PATCH] Replace Travis CI with GitHub actions --- .github/tests.yml | 0 .github/workflows/tests.yml | 36 ++++++++++++++++++++++++++++++++++++ .travis.yml | 20 -------------------- 3 files changed, 36 insertions(+), 20 deletions(-) delete mode 100644 .github/tests.yml create mode 100644 .github/workflows/tests.yml delete mode 100644 .travis.yml diff --git a/.github/tests.yml b/.github/tests.yml deleted file mode 100644 index e69de29..0000000 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..e3b0dd7 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,36 @@ +name: Polysh Tests + +on: + push: + branches: + - '*' + +jobs: + polysh-tests: + name: python + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Install uv + uses: astral-sh/setup-uv@v3 + + - name: Set up Python + run: uv python install + + - name: Install the project + run: uv sync --all-extras --dev + + - name: Prepare test environment + run: + - sudo apt-get update + - sudo apt-get install -y openssh-server + - sudo service ssh start + - ssh-keygen -t ed25519 -N "" -f ~/.ssh/id_rsa + - cat ~/.ssh/id_ed25519.pub >> ~/.ssh/authorized_keys + - echo -e "Host *\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config + - ssh -vvvv localhost exit + + - name: Run tests + run: uv run python -m unittest discover --verbose \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index dd52f18..0000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -# SSHing to localhost does not currently work in the the trusty containers, -# setting sudo to true means we will get a VM. VMs take longer to boot though.. -# https://github.com/travis-ci/travis-ci/issues/8647 -sudo: true -language: python -python: - - "3.5" - - "3.6" -install: - - pip install -r tests/requirements.txt - - ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa - - cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys - - chmod 600 ~/.ssh/authorized_keys - - cat ~/.ssh/known_hosts - - echo -e "Host *\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config - - ssh -vvvv localhost exit -script: - - ./setup.py install - - cd tests/ - - ./polysh_tests.py