xref: /freebsd/crypto/openssh/.github/workflows/upstream.yml (revision 0fdf8fae8b569bf9fff3b5171e669dcd7cf9c79e)
1name: Upstream self-hosted
2
3on:
4  push:
5    branches: [ master ]
6    paths: [ '**.c', '**.h', '**.sh', '.github/configs', '.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: 'libvirt'
13    env:
14      DEBUG_ACTIONS: true
15      EPHEMERAL: true
16      HOST: 'libvirt'
17      TARGET_HOST: ${{ matrix.target }}
18      TARGET_CONFIG: ${{ matrix.config }}
19      TARGET_DOMAIN: ${{ format('{0}-{1}-{2}', matrix.target, matrix.config, github.run_id) || matrix.target }}
20    strategy:
21      fail-fast: false
22      matrix:
23        target: [ obsdsnap, obsdsnap-i386 ]
24        config: [ default, without-openssl, ubsan ]
25    steps:
26    - name: unmount stale workspace
27      run: fusermount -u ${GITHUB_WORKSPACE} || true
28      working-directory: ${{ runner.temp }}
29    - name: shutdown VM if running
30      run: vmshutdown
31      working-directory: ${{ runner.temp }}
32    - uses: actions/checkout@main
33    - name: startup VM
34      run: vmstartup
35      working-directory: ${{ runner.temp }}
36    - name: copy and mount workspace
37      run: sshfs_mount
38      working-directory: ${{ runner.temp }}
39    - name: update source
40      run: vmrun "cd /usr/src && cvs up -dPA usr.bin/ssh regress/usr.bin/ssh"
41    - name: make clean
42      run: vmrun "cd /usr/src/usr.bin/ssh && make obj && make clean && cd /usr/src/regress/usr.bin/ssh && make obj && make clean && sudo chmod -R g-w /usr/src /usr/obj"
43    - name: make
44      run: vmrun "cd /usr/src/usr.bin/ssh && case ${{ matrix.config }} in without-openssl) make OPENSSL=no;; ubsan) make DEBUG='-fsanitize-minimal-runtime -fsanitize=undefined';; *) make; esac"
45    - name: make install
46      run: vmrun "cd /usr/src/usr.bin/ssh && sudo make install && sudo /etc/rc.d/sshd -f restart"
47    - name: make tests`
48      run: vmrun "cd /usr/src/regress/usr.bin/ssh && case ${{ matrix.config }} in without-openssl) make OPENSSL=no;; ubsan) make DEBUG='-fsanitize-minimal-runtime -fsanitize=undefined';; *) make; esac"
49      env:
50        SUDO: sudo
51      timeout-minutes: 300
52    - name: save logs
53      if: failure()
54      uses: actions/upload-artifact@main
55      with:
56        name: ${{ matrix.target }}-${{ matrix.config }}-logs
57        path: |
58          /usr/obj/regress/usr.bin/ssh/obj/*.log
59          /usr/obj/regress/usr.bin/ssh/obj/log/*
60    - name: unmount workspace
61      if: always()
62      run: fusermount -u ${GITHUB_WORKSPACE} || true
63      working-directory: ${{ runner.temp }}
64    - name: shutdown VM
65      if: always()
66      run: vmshutdown
67      working-directory: ${{ runner.temp }}
68