summaryrefslogtreecommitdiffstats
path: root/.github/workflows/upstream.yml
blob: e25adb423917dbbbb4575faf5866145a60837149 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Upstream self-hosted

on:
  push:
    branches: [ master ]
    paths: [ '**.c', '**.h', '**.sh', '.github/configs', '.github/workflows/upstream.yml' ]

jobs:
  selfhosted:
    name: "upstream ${{ matrix.target }} ${{ matrix.config }}"
    if: github.repository == 'openssh/openssh-portable-selfhosted'
    runs-on: 'libvirt'
    env:
      DEBUG_ACTIONS: true
      EPHEMERAL: true
      HOST: 'libvirt'
      TARGET_HOST: ${{ matrix.target }}
      TARGET_CONFIG: ${{ matrix.config }}
      TARGET_DOMAIN: ${{ format('{0}-{1}-{2}', matrix.target, matrix.config, github.run_id) || matrix.target }}
    strategy:
      fail-fast: false
      matrix:
        target: [ obsdsnap, obsdsnap-i386 ]
        config: [ default, without-openssl, ubsan ]
    steps:
    - name: unmount stale workspace
      run: fusermount -u ${GITHUB_WORKSPACE} || true
      working-directory: ${{ runner.temp }}
    - name: shutdown VM if running
      run: vmshutdown
      working-directory: ${{ runner.temp }}
    - uses: actions/checkout@main
    - name: startup VM
      run: vmstartup
      working-directory: ${{ runner.temp }}
    - name: copy and mount workspace
      run: sshfs_mount
      working-directory: ${{ runner.temp }}
    - name: update source
      run: vmrun "cd /usr/src && cvs up -dPA usr.bin/ssh regress/usr.bin/ssh"
    - name: make clean
      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"
    - name: make
      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"
    - name: make install
      run: vmrun "cd /usr/src/usr.bin/ssh && sudo make install && sudo /etc/rc.d/sshd -f restart"
    - name: make tests`
      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"
      env:
        SUDO: sudo
      timeout-minutes: 300
    - name: save logs
      if: failure()
      uses: actions/upload-artifact@main
      with:
        name: ${{ matrix.target }}-${{ matrix.config }}-logs
        path: |
          /usr/obj/regress/usr.bin/ssh/obj/*.log
          /usr/obj/regress/usr.bin/ssh/obj/log/*
    - name: unmount workspace
      if: always()
      run: fusermount -u ${GITHUB_WORKSPACE} || true
      working-directory: ${{ runner.temp }}
    - name: shutdown VM
      if: always()
      run: vmshutdown
      working-directory: ${{ runner.temp }}