diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2022-02-24 10:49:27 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2022-02-24 10:49:27 -0500 |
commit | 81bc52baa51f7615f11338b80c98dff86c1578f7 (patch) | |
tree | 517fac0c9f4427fa8ff31269cc908966bd005f5b /.github | |
parent | 9e86475fd0f0b7b010abaf6f2df5cbbb21dc8dfb (diff) | |
download | bfs-81bc52baa51f7615f11338b80c98dff86c1578f7.tar.xz |
ci: Unify multiple workflows into one with separate jobs
Diffstat (limited to '.github')
-rw-r--r-- | .github/workflows/ci.yml | 87 | ||||
-rw-r--r-- | .github/workflows/freebsd.yml | 33 | ||||
-rw-r--r-- | .github/workflows/linux.yml | 38 | ||||
-rw-r--r-- | .github/workflows/macos.yml | 18 |
4 files changed, 87 insertions, 89 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..f5d27e1 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,87 @@ +name: distcheck + +on: [push, pull_request] + +jobs: + linux: + name: Linux + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + + - name: Install dependencies + run: | + sudo dpkg --add-architecture i386 + sudo apt-get update -y + sudo apt-get install -y \ + gcc-multilib \ + acl \ + libacl1-dev \ + libacl1:i386 \ + attr \ + libattr1-dev \ + libattr1:i386 \ + libcap2-bin \ + libcap-dev \ + libcap2:i386 \ + libonig-dev \ + libonig5:i386 + # Ubuntu doesn't let you install the -dev packages for both amd64 and + # i386 at once, so we make our own symlinks to fix -m32 -lacl -lattr -lcap + sudo ln -s libacl.so.1 /lib/i386-linux-gnu/libacl.so + sudo ln -s libattr.so.1 /lib/i386-linux-gnu/libattr.so + sudo ln -s libcap.so.2 /lib/i386-linux-gnu/libcap.so + sudo ln -s libonig.so.5 /lib/i386-linux-gnu/libonig.so + + - name: Run tests + run: | + make -j$(nproc) distcheck + + macos: + name: macOS + + runs-on: macos-latest + + steps: + - uses: actions/checkout@v2 + + - name: Install dependencies + run: | + brew install coreutils + + - name: Run tests + run: | + make -j$(sysctl -n hw.ncpu) distcheck + + freebsd: + name: FreeBSD + + if: ${{ github.repository_owner == 'tavianator' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }} + + runs-on: ubuntu-latest + + concurrency: muon + + steps: + - uses: actions/checkout@v2 + + - uses: tailscale/github-action@main + with: + authkey: ${{ secrets.TAILSCALE_KEY }} + + - 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 %s\n\tStrictHostKeyChecking=accept-new\n\tUser github\n\tIdentityFile ~/.ssh/github-actions\n' "$(tailscale ip -6 muon)" >~/.ssh/config + + - name: Run tests + run: | + muon=$(tailscale ip -6 muon) + rsync -rl --delete . "[$muon]:bfs" + ssh "$muon" 'gmake -C bfs -j$(sysctl -n hw.ncpu) distcheck' diff --git a/.github/workflows/freebsd.yml b/.github/workflows/freebsd.yml deleted file mode 100644 index 82c0275..0000000 --- a/.github/workflows/freebsd.yml +++ /dev/null @@ -1,33 +0,0 @@ -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 - - concurrency: muon - - steps: - - uses: actions/checkout@v2 - - - uses: tailscale/github-action@main - with: - authkey: ${{ secrets.TAILSCALE_KEY }} - - - 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 %s\n\tStrictHostKeyChecking=accept-new\n\tUser github\n\tIdentityFile ~/.ssh/github-actions\n' "$(tailscale ip -6 muon)" >~/.ssh/config - - - name: Run tests - run: | - muon=$(tailscale ip -6 muon) - rsync -rl --delete . "[$muon]:bfs" - ssh "$muon" 'gmake -C bfs -j$(sysctl -n hw.ncpu) distcheck' diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml deleted file mode 100644 index dbbe3b4..0000000 --- a/.github/workflows/linux.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Linux - -on: [push, pull_request] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - - name: Install dependencies - run: | - sudo dpkg --add-architecture i386 - sudo apt-get update -y - sudo apt-get install -y \ - gcc-multilib \ - acl \ - libacl1-dev \ - libacl1:i386 \ - attr \ - libattr1-dev \ - libattr1:i386 \ - libcap2-bin \ - libcap-dev \ - libcap2:i386 \ - libonig-dev \ - libonig5:i386 - # Ubuntu doesn't let you install the -dev packages for both amd64 and - # i386 at once, so we make our own symlinks to fix -m32 -lacl -lattr -lcap - sudo ln -s libacl.so.1 /lib/i386-linux-gnu/libacl.so - sudo ln -s libattr.so.1 /lib/i386-linux-gnu/libattr.so - sudo ln -s libcap.so.2 /lib/i386-linux-gnu/libcap.so - sudo ln -s libonig.so.5 /lib/i386-linux-gnu/libonig.so - - - name: Run tests - run: | - make -j$(nproc) distcheck diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml deleted file mode 100644 index 39a0f9c..0000000 --- a/.github/workflows/macos.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: macOS - -on: [push, pull_request] - -jobs: - build: - runs-on: macos-latest - - steps: - - uses: actions/checkout@v2 - - - name: Install dependencies - run: | - brew install coreutils - - - name: Run tests - run: | - make -j$(sysctl -n hw.ncpu) distcheck |