summaryrefslogtreecommitdiffstats
path: root/.github/workflows/freebsd.yml
blob: 3148e94815072a17835be753e80031356e96281d (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
name: FreeBSD

on: [push, pull_request]

jobs:
  build:
    if: ${{ github.repository_owner == 'tavianator' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}

    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Install dependencies
        run: |
          curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/focal.gpg | sudo apt-key add -
          curl -fsSL https://pkgs.tailscale.com/stable/ubuntu/focal.list | sudo tee /etc/apt/sources.list.d/tailscale.list
          sudo apt-get update -y
          sudo apt-get install -y tailscale

      - name: Configure Tailscale
        env:
          TAILSCALE_KEY: ${{ secrets.TAILSCALE_KEY }}
        run: |
          sudo tailscale up --authkey="$TAILSCALE_KEY"
          tailscale netcheck

      - name: Configure SSH
        env:
          SSH_KEY: ${{ secrets.SSH_KEY }}
        run: |
          mkdir ~/.ssh
          printf '%s' "$SSH_KEY" >~/.ssh/github-actions
          chmod 0600 ~/.ssh/github-actions
          printf 'Host fd7a:115c:a1e0:ab12:4843:cd96:6265:b302\n\tStrictHostKeyChecking=accept-new\n\tUser github\n\tIdentityFile ~/.ssh/github-actions\n' >~/.ssh/config

      - name: Run tests
        run: |
          rsync -rl --delete . '[fd7a:115c:a1e0:ab12:4843:cd96:6265:b302]':bfs
          ssh fd7a:115c:a1e0:ab12:4843:cd96:6265:b302 'gmake -C bfs -j$(sysctl -n hw.ncpu) distcheck'