Changeset ed493e6 in mod_gnutls


Ignore:
Timestamp:
Jun 24, 2020, 6:05:11 PM (5 months ago)
Author:
Fiona Klute <fiona.klute@…>
Branches:
asyncio, master
Children:
22a737b
Parents:
3e7427a
git-author:
Fiona Klute <fiona.klute@…> (06/24/20 18:02:48)
git-committer:
Fiona Klute <fiona.klute@…> (06/24/20 18:05:11)
Message:

CI: Detect network addresses for tests

File:
1 edited

Legend:

Unmodified
Added
Removed
  • .github/workflows/build.yml

    r3e7427a red493e6  
    3636          ip addr show
    3737          cat /etc/hosts
     38      - name: find usable IPs for tests
     39        shell: python3 {0}
     40        run: |
     41          import socket
     42          def try_connect(sockaddr):
     43              af, socktype, proto, canonname, sa = sockaddr
     44              try:
     45                  s = socket.socket(af, socktype, proto)
     46                  s.connect(sa)
     47              except:
     48                  return False
     49              finally:
     50                  s.close()
     51              return True
     52
     53          test_ips = []
     54          for name in ['localhost', socket.gethostname()]:
     55              addrs = list(map(lambda t: t[-1][0], filter(try_connect, socket.getaddrinfo(name, 123, proto=socket.IPPROTO_UDP))))
     56              print(f'{name}: {addrs}')
     57              test_ips += addrs
     58          # IPv6 addresses must be enclosed in square brackets
     59          test_ips = [f'[{i}]' if ':' in i else i for i in test_ips]
     60          print(f'::set-env name=test_ips::{" ".join(test_ips)}')
    3861      - name: set prefix for container-specific artifacts
    3962        # this is because upload-artifact doesn't like ":" in file names
     
    4568        run: autoreconf -fiv
    4669      - name: configure
    47         run: TEST_IP=127.0.0.1 APACHE_MUTEX=pthread ./configure
     70        run: TEST_IP="${test_ips}" APACHE_MUTEX=pthread ./configure
    4871      - name: store config.log
    4972        uses: actions/upload-artifact@v1
Note: See TracChangeset for help on using the changeset viewer.