|
| 1 | +--- |
| 2 | +name: tests |
| 3 | + |
| 4 | +on: [push] |
| 5 | + |
| 6 | +jobs: |
| 7 | + check: |
| 8 | + name: Go ${{ matrix.go }} checks |
| 9 | + runs-on: ubuntu-latest |
| 10 | + strategy: |
| 11 | + fail-fast: false |
| 12 | + matrix: |
| 13 | + go: [ 'stable', 'oldstable' ] |
| 14 | + steps: |
| 15 | + - name: Checkout code |
| 16 | + uses: actions/checkout@v4 |
| 17 | + |
| 18 | + - name: Setup go |
| 19 | + uses: actions/setup-go@v5 |
| 20 | + with: |
| 21 | + go-version: ${{ matrix.go }} |
| 22 | + |
| 23 | + - name: Install build tools |
| 24 | + run: | |
| 25 | + sudo apt-get update |
| 26 | + sudo apt-get install -y asciidoc docbook-utils docbook-xml libxml2-utils xsltproc |
| 27 | +
|
| 28 | + - name: Build sshproxy |
| 29 | + run: make |
| 30 | + |
| 31 | + - name: Run checks |
| 32 | + run: make get-deps check |
| 33 | + |
| 34 | + test: |
| 35 | + name: Docker tests |
| 36 | + runs-on: ubuntu-latest |
| 37 | + steps: |
| 38 | + - name: Checkout code |
| 39 | + uses: actions/checkout@v4 |
| 40 | + |
| 41 | + - name: Run tests |
| 42 | + run: make test |
| 43 | + |
| 44 | + binary-archive: |
| 45 | + name: Publish binary archive |
| 46 | + runs-on: ubuntu-latest |
| 47 | + steps: |
| 48 | + - name: Checkout code |
| 49 | + uses: actions/checkout@v4 |
| 50 | + |
| 51 | + - name: Setup go |
| 52 | + uses: actions/setup-go@v5 |
| 53 | + with: |
| 54 | + go-version: 'stable' |
| 55 | + |
| 56 | + - name: Build sshproxy |
| 57 | + run: make binary-archive |
| 58 | + |
| 59 | + - name: Attach binary archive to release |
| 60 | + uses: xresloader/upload-to-github-release@v1 |
| 61 | + env: |
| 62 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 63 | + with: |
| 64 | + file: "sshproxy_*.tar.gz" |
| 65 | + tags: true |
| 66 | + draft: true |
| 67 | + |
| 68 | + rpm: |
| 69 | + name: Publish RPMs |
| 70 | + runs-on: ubuntu-latest |
| 71 | + container: |
| 72 | + image: rockylinux/rockylinux:9 |
| 73 | + options: --privileged |
| 74 | + strategy: |
| 75 | + fail-fast: false |
| 76 | + matrix: |
| 77 | + include: |
| 78 | + - target: rocky+epel-8-x86_64 |
| 79 | + arch: x86_64 |
| 80 | + dist: el8 |
| 81 | + - target: rocky+epel-9-x86_64 |
| 82 | + arch: x86_64 |
| 83 | + dist: el9 |
| 84 | + steps: |
| 85 | + - name: Prepare mock and rpm-build |
| 86 | + run: | |
| 87 | + dnf -y install epel-release |
| 88 | + dnf -y install git make mock rpm-build |
| 89 | + echo "config_opts['print_main_output'] = True" >>/etc/mock/site-defaults.cfg |
| 90 | +
|
| 91 | + - name: Checkout code |
| 92 | + uses: actions/checkout@v4 |
| 93 | + with: |
| 94 | + fetch-depth: 0 |
| 95 | + |
| 96 | + - name: Create source archive |
| 97 | + run: | |
| 98 | + git config --global --add safe.directory /__w/sshproxy/sshproxy |
| 99 | + make source-archive |
| 100 | +
|
| 101 | + - name: Build RPMs |
| 102 | + run: mock -r ${{ matrix.target }} --rebuild --spec=misc/sshproxy.spec --sources=. |
| 103 | + |
| 104 | + - name: Attach RPM and SRPM to release |
| 105 | + uses: xresloader/upload-to-github-release@v1 |
| 106 | + env: |
| 107 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 108 | + with: |
| 109 | + file: "/var/lib/mock/${{ matrix.target }}/result/sshproxy-*.rpm" |
| 110 | + tags: true |
| 111 | + draft: true |
0 commit comments