diff options
author | Miklós Fazekas <mfazekas@szemafor.com> | 2021-01-21 12:37:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-21 12:37:07 +0100 |
commit | 16996c8dfafc24cebbf98899849fa7d1a300bed0 (patch) | |
tree | 91a4517ec7ced468d74e529d081f7a49037ec122 | |
parent | 4817a2a23ec0131b817450a9c137ad794c559c05 (diff) | |
parent | f8042c7914bde4b8e17314d495917f8b750cb3d7 (diff) | |
download | net-ssh-16996c8dfafc24cebbf98899849fa7d1a300bed0.tar.gz |
Merge pull request #792 from net-ssh/test-github-actions
GitHub Actions: Fixed env
-rw-r--r-- | .github/workflows/ci.yml | 56 | ||||
-rw-r--r-- | test/test_known_hosts.rb | 2 |
2 files changed, 46 insertions, 12 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b01d2c5..110d46f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,24 +5,36 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - ruby-version: [2.7.x, 2.6.x, 2.5.x] + ruby-version: [2.7.2, 2.6.6, 2.5.8, 2.4.10, 3.0.0] steps: - uses: actions/checkout@v1 - name: Set up Ruby ${{ matrix.ruby-version }} - uses: actions/setup-ruby@v1 + uses: ruby/setup-ruby@v1 with: ruby-version: ${{ matrix.ruby-version }} + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: 2.7 - name: Cache bundler uses: actions/cache@v1 id: bundler-cache with: path: vendor/bundle - key: ${{ runner.os }}-gem-v2-${{ hashFiles('**/.ruby-version') }}-${{ hashFiles('**/Gemfile.lock') }} + key: ${{ runner.os }}-${{ matrix.ruby-version }}-gem-v3-${{ hashFiles('**/Gemfile') }}-${{ hashFiles('**/net-ssh.gemspec') }} restore-keys: | - ${{ runner.os }}-gem-v2- - + ${{ runner.os }}-${{ matrix.ruby-version }}-gem-v3- + + - name: Cache pip + uses: actions/cache@v1 + id: pip-cache + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-v1 + restore-keys: | + ${{ runner.os }}-pip-v1 - name: Bundle install run: | gem install bundler @@ -32,11 +44,33 @@ jobs: BUNDLE_GEMFILE=./Gemfile.noed25519 bundle install --jobs 4 --retry 3 --path vendor/bundle env: BUNDLE_PATH: vendor/bundle - - - name: Run Tests - run: bundle _1.17_ exec rake test + + - name: Add to etc/hosts + run: | + sudo echo "127.0.0.1 gateway.netssh" | sudo tee -a /etc/hosts + - name: Ansible install + run: | + python -m pip install --upgrade pip + pip install ansible urllib3 pyOpenSSL ndg-httpsclient pyasn1 + ansible-galaxy install rvm.ruby + pwd + uname -a + export + who am i + ansible-playbook ./test/integration/playbook.yml -i "localhost," --become -c local -e 'no_rvm=true' -e 'myuser=runner' -e 'mygroup=runner' -e 'homedir=/home/runner' - name: Run Tests - run: bundle _1.17_ exec rake test - end: - BUNDLE_GEMFILE=./Gemfile.noed25519 + run: bundle exec rake test + env: + NET_SSH_RUN_INTEGRATION_TESTS_DISABLED: 1 + - name: Run Tests (without ed25519) + run: bundle exec rake test + env: + BUNDLE_GEMFILE: ./Gemfile.noed25519 + NET_SSH_RUN_INTEGRATION_TESTS_DISABLED: 1 + - name: Run test helper test + run: bundle exec rake test_test + - name: Rubocop + if: matrix.ruby-version != '3.0.0' + run: bundle exec rubocop +
\ No newline at end of file diff --git a/test/test_known_hosts.rb b/test/test_known_hosts.rb index 6b1fda6..fcd64fa 100644 --- a/test/test_known_hosts.rb +++ b/test/test_known_hosts.rb @@ -35,7 +35,7 @@ class TestKnownHosts < NetSSHTest end def test_search_for - options = { user_known_hosts_file: path("known_hosts/github") } + options = { user_known_hosts_file: path("known_hosts/github"), global_known_hosts_file: [] } keys = Net::SSH::KnownHosts.search_for('github.com',options) assert_equal(["ssh-rsa"], keys.map(&:ssh_type)) end |