Merge pull request #1803 from basecamp/otel-deploy-logs #2740
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: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| rubocop: | |
| name: RuboCop | |
| runs-on: ubuntu-latest | |
| env: | |
| BUNDLE_ONLY: rubocop | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: Setup Ruby and install gems | |
| uses: ruby/setup-ruby@708024e6c902387ab41de36e1669e43b5ee7085e # v1.283.0 | |
| with: | |
| ruby-version: 3.3.0 | |
| bundler-cache: true | |
| - name: Run Rubocop | |
| run: bundle exec rubocop --parallel | |
| lint-actions: | |
| name: GitHub Actions audit | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Run actionlint | |
| uses: rhysd/actionlint@393031adb9afb225ee52ae2ccd7a5af5525e03e8 # v1.7.11 | |
| - name: Run zizmor | |
| uses: zizmorcore/zizmor-action@71321a20a9ded102f6e9ce5718a2fcec2c4f70d8 # v0.5.2 | |
| with: | |
| advanced-security: false | |
| tests: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| ruby-version: | |
| - "3.2" | |
| - "3.3" | |
| - "3.4" | |
| - "4.0" | |
| gemfile: | |
| - Gemfile | |
| - gemfiles/rails_edge.gemfile | |
| exclude: | |
| - ruby-version: "3.2" | |
| gemfile: gemfiles/rails_edge.gemfile | |
| name: ${{ format('Tests (Ruby {0})', matrix.ruby-version) }} | |
| runs-on: ubuntu-latest | |
| env: | |
| BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }} | |
| steps: | |
| - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| with: | |
| persist-credentials: false | |
| - name: Remove gemfile.lock | |
| run: rm Gemfile.lock | |
| - name: Install Ruby | |
| uses: ruby/setup-ruby@708024e6c902387ab41de36e1669e43b5ee7085e # v1.283.0 | |
| with: | |
| ruby-version: ${{ matrix.ruby-version }} | |
| bundler-cache: true | |
| - name: Configure Docker with VFS storage driver | |
| run: | | |
| sudo systemctl stop docker | |
| sudo systemctl stop docker.socket | |
| sudo mkdir -p /etc/docker /mnt/docker | |
| cat <<'EOF' | sudo tee /etc/docker/daemon.json | |
| { | |
| "storage-driver": "vfs", | |
| "data-root": "/mnt/docker" | |
| } | |
| EOF | |
| sudo rm -rf /var/lib/docker/* /mnt/docker/* | |
| sudo systemctl start docker | |
| timeout 30 sh -c 'until docker info >/dev/null 2>&1; do sleep 1; done' | |
| df -h | |
| - name: Run tests | |
| run: bin/test | |
| env: | |
| RUBYOPT: ${{ startsWith(matrix.ruby-version, '3.4.') && '--enable=frozen-string-literal' || '' }} | |
| - name: Check disk usage | |
| if: always() | |
| run: | | |
| df -h | |
| sudo du -sh /mnt/docker |