Support linux jail on FreeBSD #2861
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - '**' | |
| tags-ignore: | |
| - 'v*' | |
| workflow_dispatch: | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ruby | |
| bundler-cache: true | |
| - name: Lint | |
| run: bundle exec rake rubocop | |
| spec: | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| vm: | |
| os: freebsd | |
| run: | | |
| pkg install -y node npm protobuf ruby rubygem-bundler rubygem-rake | |
| - os: ubuntu-latest | |
| vm: | |
| os: freebsd | |
| run: | | |
| pkg install -y node npm protobuf ruby rubygem-bundler rubygem-rake | |
| sysrc linux_enable="YES" | |
| service linux start | |
| - os: ubuntu-latest | |
| vm: | |
| os: freebsd | |
| run: | | |
| pkg install -y debootstrap ruby rubygem-bundler rubygem-rake | |
| sysrc linux_enable="YES" | |
| service linux start | |
| debootstrap jammy /compat/ubuntu | |
| ln -sf ../lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 /compat/ubuntu/lib64/ld-linux-x86-64.so.2 | |
| mount -t linprocfs linproc /compat/ubuntu/proc | |
| sysctl compat.linux.emul_path=/compat/ubuntu | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Initialize vm | |
| if: matrix.vm | |
| uses: ./.github/actions/setup-vm | |
| with: | |
| os: ${{ matrix.vm.os }} | |
| run: ${{ matrix.vm.run }} | |
| - name: Bundle | |
| run: bundle install | |
| - name: Compile | |
| run: bundle exec rake compile | |
| - name: Spec | |
| if: "!matrix.vm || contains(matrix.vm.run, 'sysctl compat.linux.emul_path')" | |
| run: bundle exec rake spec | |
| - name: Install | |
| run: rake -f -r bundler/gem_tasks install | |
| release: | |
| if: github.event.repository.fork == false && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) | |
| needs: [lint, spec] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| ssh-key: ${{ secrets.DEPLOY_KEY }} | |
| - name: Setup ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ruby | |
| - name: Release | |
| run: | | |
| git config user.email 41898282+github-actions[bot]@users.noreply.github.com | |
| git config user.name github-actions[bot] | |
| rake -f -r bundler/gem_tasks release gem_push=no |