1name: OpenBSD 2 3on: 4 push: 5 branches: [ master ] 6 paths: [ '**.c', '**.h', '**.sh', '.github/workflows/upstream.yml' ] 7 8jobs: 9 selfhosted: 10 name: "upstream ${{ matrix.target }} ${{ matrix.config }}" 11 if: github.repository == 'openssh/openssh-portable-selfhosted' 12 runs-on: ${{ matrix.host }} 13 env: 14 EPHEMERAL: true 15 HOST: ${{ matrix.host }} 16 TARGET_HOST: ${{ matrix.target }} 17 TARGET_CONFIG: ${{ matrix.config }} 18 TARGET_DOMAIN: ${{ format('{0}-{1}-{2}', matrix.target, matrix.config, github.run_id) || matrix.target }} 19 strategy: 20 fail-fast: false 21 matrix: 22 host: 23 - libvirt 24 target: [ obsdsnap, obsdsnap-i386 ] 25 # TODO: restore 'ubsan' once fixed 26 config: [ default, kerberos5, without-openssl ] 27 include: 28 - { host: libvirt-arm64, target: obsdsnap-arm64, config: default } 29 - { host: libvirt-arm64, target: obsdsnap-arm64, config: kerberos5 } 30 - { host: libvirt-arm64, target: obsdsnap-arm64, config: without-openssl } 31 # - { host: libvirt-arm64, target: obsdsnap-arm64, config: ubsan } 32 steps: 33 - name: unmount stale workspace 34 run: fusermount -u ${GITHUB_WORKSPACE} || true 35 working-directory: ${{ runner.temp }} 36 - name: shutdown VM if running 37 run: vmshutdown 38 working-directory: ${{ runner.temp }} 39 - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # main 40 - name: startup VM 41 run: vmstartup 42 working-directory: ${{ runner.temp }} 43 - name: copy and mount workspace 44 run: sshfs_mount 45 working-directory: ${{ runner.temp }} 46 - name: update source 47 run: vmrun "cd /usr/src && if [ -d .git ]; then git pull && git log -n1; else cvs -q up -dPA usr.bin/ssh regress/usr.bin/ssh usr.bin/nc; fi" 48 - name: set build options in /etc/mk.conf 49 run: | 50 case ${{ matrix.config }} in \ 51 without-openssl) o='OPENSSL=no' ;; \ 52 kerberos5) o='KERBEROS5=yes' ;; \ 53 ubsan) o='DEBUG=-fsanitize-minimal-runtime -fsanitize=undefined';; \ 54 esac 55 vmrun "echo $o | sudo tee -a /etc/mk.conf" 56 - name: update netcat 57 run: vmrun "cd /usr/src/usr.bin/nc && make clean all && sudo make install" 58 - name: make clean 59 run: vmrun "make -C /usr/src/usr.bin/ssh obj clean && make -C /usr/src/regress/usr.bin/ssh obj clean && sudo chmod -R g-w /usr/src /usr/obj" 60 - name: make 61 run: vmrun " make -C /usr/src/usr.bin/ssh" 62 - name: make install 63 run: vmrun "sudo make -C /usr/src/usr.bin/ssh install && sudo /etc/rc.d/sshd -f restart" 64 - name: make tests` 65 run: vmrun "cd /usr/src/regress/usr.bin/ssh && case ${{ matrix.config }} in without-openssl) make OPENSSL=no;; *) make;; esac" 66 env: 67 SUDO: sudo 68 timeout-minutes: 300 69 - name: show logs 70 if: failure() 71 run: vmrun 'for i in /usr/src/regress/usr.bin/ssh/obj/*.log; do echo ====; echo logfile $i; echo =====; cat $i; done' 72 - name: save logs 73 if: failure() 74 uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # main 75 with: 76 name: ${{ matrix.target }}-${{ matrix.config }}-logs 77 path: | 78 /usr/src/regress/usr.bin/ssh/obj/*.log 79 /usr/src/regress/usr.bin/ssh/obj/log/* 80 - name: unmount workspace 81 if: always() 82 run: | 83 fusermount -u ${GITHUB_WORKSPACE} || true 84 fusermount -z -u ${GITHUB_WORKSPACE} || true 85 working-directory: ${{ runner.temp }} 86 - name: shutdown VM 87 if: always() 88 run: vmshutdown 89 working-directory: ${{ runner.temp }} 90