run_tests.yml

  1# Generated from xtask::workflows::run_tests
  2# Rebuild with `cargo xtask workflows`.
  3name: run_tests
  4env:
  5  CARGO_TERM_COLOR: always
  6  RUST_BACKTRACE: '1'
  7  CARGO_INCREMENTAL: '0'
  8on:
  9  pull_request:
 10    branches:
 11    - '**'
 12    paths:
 13    - '!docs/**'
 14    - '!script/update_top_ranking_issues/**'
 15    - '!.github/ISSUE_TEMPLATE/**'
 16    - '!.github/workflows/**'
 17    - .github/workflows/run_tests.yml
 18  push:
 19    branches:
 20    - main
 21    - v[0-9]+.[0-9]+.x
 22    paths:
 23    - '!docs/**'
 24    - '!script/update_top_ranking_issues/**'
 25    - '!.github/ISSUE_TEMPLATE/**'
 26    - '!.github/workflows/**'
 27    - .github/workflows/run_tests.yml
 28jobs:
 29  run_tests_windows:
 30    if: github.repository_owner == 'zed-industries'
 31    runs-on: self-32vcpu-windows-2022
 32    steps:
 33    - name: steps::checkout_repo
 34      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
 35      with:
 36        clean: false
 37    - name: steps::setup_cargo_config
 38      run: |
 39        New-Item -ItemType Directory -Path "./../.cargo" -Force
 40        Copy-Item -Path "./.cargo/ci-config.toml" -Destination "./../.cargo/config.toml"
 41      shell: pwsh
 42    - name: steps::setup_node
 43      uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
 44      with:
 45        node-version: '20'
 46    - name: steps::clippy
 47      run: ./script/clippy.ps1
 48      shell: pwsh
 49    - name: steps::cargo_install_nextest
 50      run: cargo install cargo-nextest --locked
 51      shell: pwsh
 52    - name: steps::clear_target_dir_if_large
 53      run: ./script/clear-target-dir-if-larger-than.ps1 250
 54      shell: pwsh
 55    - name: steps::cargo_nextest
 56      run: cargo nextest run --workspace --no-fail-fast --failure-output immediate-final
 57      shell: pwsh
 58    - name: steps::cleanup_cargo_config
 59      if: always()
 60      run: |
 61        Remove-Item -Recurse -Path "./../.cargo" -Force -ErrorAction SilentlyContinue
 62      shell: pwsh
 63    timeout-minutes: 60
 64  run_tests_linux:
 65    if: github.repository_owner == 'zed-industries'
 66    runs-on: namespace-profile-16x32-ubuntu-2204
 67    steps:
 68    - name: steps::checkout_repo
 69      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
 70      with:
 71        clean: false
 72    - name: steps::setup_cargo_config
 73      run: |
 74        mkdir -p ./../.cargo
 75        cp ./.cargo/ci-config.toml ./../.cargo/config.toml
 76      shell: bash -euxo pipefail {0}
 77    - name: steps::setup_linux
 78      run: ./script/linux
 79      shell: bash -euxo pipefail {0}
 80    - name: steps::install_mold
 81      run: ./script/install-mold
 82      shell: bash -euxo pipefail {0}
 83    - name: steps::setup_node
 84      uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
 85      with:
 86        node-version: '20'
 87    - name: steps::clippy
 88      run: ./script/clippy
 89      shell: bash -euxo pipefail {0}
 90    - name: steps::cargo_install_nextest
 91      run: cargo install cargo-nextest --locked
 92      shell: bash -euxo pipefail {0}
 93    - name: steps::clear_target_dir_if_large
 94      run: ./script/clear-target-dir-if-larger-than 100
 95      shell: bash -euxo pipefail {0}
 96    - name: steps::cargo_nextest
 97      run: cargo nextest run --workspace --no-fail-fast --failure-output immediate-final
 98      shell: bash -euxo pipefail {0}
 99    - name: steps::cleanup_cargo_config
100      if: always()
101      run: |
102        rm -rf ./../.cargo
103      shell: bash -euxo pipefail {0}
104    timeout-minutes: 60
105  run_tests_mac:
106    if: github.repository_owner == 'zed-industries'
107    runs-on: self-mini-macos
108    steps:
109    - name: steps::checkout_repo
110      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
111      with:
112        clean: false
113    - name: steps::setup_cargo_config
114      run: |
115        mkdir -p ./../.cargo
116        cp ./.cargo/ci-config.toml ./../.cargo/config.toml
117      shell: bash -euxo pipefail {0}
118    - name: steps::setup_node
119      uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020
120      with:
121        node-version: '20'
122    - name: steps::clippy
123      run: ./script/clippy
124      shell: bash -euxo pipefail {0}
125    - name: steps::cargo_install_nextest
126      run: cargo install cargo-nextest --locked
127      shell: bash -euxo pipefail {0}
128    - name: steps::clear_target_dir_if_large
129      run: ./script/clear-target-dir-if-larger-than 300
130      shell: bash -euxo pipefail {0}
131    - name: steps::cargo_nextest
132      run: cargo nextest run --workspace --no-fail-fast --failure-output immediate-final
133      shell: bash -euxo pipefail {0}
134    - name: steps::cleanup_cargo_config
135      if: always()
136      run: |
137        rm -rf ./../.cargo
138      shell: bash -euxo pipefail {0}
139    timeout-minutes: 60
140  check_postgres_and_protobuf_migrations:
141    if: github.repository_owner == 'zed-industries'
142    runs-on: self-mini-macos
143    steps:
144    - name: steps::checkout_repo
145      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
146      with:
147        fetch-depth: 0
148    - name: run_tests::check_postgres_and_protobuf_migrations::remove_untracked_files
149      run: git clean -df
150      shell: bash -euxo pipefail {0}
151    - name: run_tests::check_postgres_and_protobuf_migrations::ensure_fresh_merge
152      run: |
153        if [ -z "$GITHUB_BASE_REF" ];
154        then
155          echo "BUF_BASE_BRANCH=$(git merge-base origin/main HEAD)" >> "$GITHUB_ENV"
156        else
157          git checkout -B temp
158          git merge -q "origin/$GITHUB_BASE_REF" -m "merge main into temp"
159          echo "BUF_BASE_BRANCH=$GITHUB_BASE_REF" >> "$GITHUB_ENV"
160        fi
161      shell: bash -euxo pipefail {0}
162    - name: run_tests::check_postgres_and_protobuf_migrations::bufbuild_setup_action
163      uses: bufbuild/buf-setup-action@v1
164      with:
165        version: v1.29.0
166    - name: run_tests::check_postgres_and_protobuf_migrations::bufbuild_breaking_action
167      uses: bufbuild/buf-breaking-action@v1
168      with:
169        input: crates/proto/proto/
170        against: https://github.com/${GITHUB_REPOSITORY}.git#branch=${BUF_BASE_BRANCH},subdir=crates/proto/proto/
171    timeout-minutes: 60
172  doctests:
173    if: github.repository_owner == 'zed-industries'
174    runs-on: namespace-profile-16x32-ubuntu-2204
175    steps:
176    - name: steps::checkout_repo
177      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
178      with:
179        clean: false
180    - name: steps::cache_rust_dependencies
181      uses: swatinem/rust-cache@9d47c6ad4b02e050fd481d890b2ea34778fd09d6
182      with:
183        save-if: ${{ github.ref == 'refs/heads/main' }}
184    - name: steps::setup_linux
185      run: ./script/linux
186      shell: bash -euxo pipefail {0}
187    - name: steps::install_mold
188      run: ./script/install-mold
189      shell: bash -euxo pipefail {0}
190    - name: steps::setup_cargo_config
191      run: |
192        mkdir -p ./../.cargo
193        cp ./.cargo/ci-config.toml ./../.cargo/config.toml
194      shell: bash -euxo pipefail {0}
195    - id: run_doctests
196      name: run_tests::doctests::run_doctests
197      run: |
198        cargo test --workspace --doc --no-fail-fast
199      shell: bash -euxo pipefail {0}
200    - name: steps::cleanup_cargo_config
201      if: always()
202      run: |
203        rm -rf ./../.cargo
204      shell: bash -euxo pipefail {0}
205    timeout-minutes: 60
206  check_dependencies:
207    if: github.repository_owner == 'zed-industries'
208    runs-on: namespace-profile-2x4-ubuntu-2404
209    steps:
210    - name: steps::checkout_repo
211      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
212      with:
213        clean: false
214    - name: run_tests::check_dependencies::install_cargo_machete
215      uses: clechasseur/rs-cargo@8435b10f6e71c2e3d4d3b7573003a8ce4bfc6386
216      with:
217        command: install
218        args: cargo-machete@0.7.0
219    - name: run_tests::check_dependencies::run_cargo_machete
220      uses: clechasseur/rs-cargo@8435b10f6e71c2e3d4d3b7573003a8ce4bfc6386
221      with:
222        command: machete
223    - name: run_tests::check_dependencies::check_cargo_lock
224      run: cargo update --locked --workspace
225      shell: bash -euxo pipefail {0}
226    - name: run_tests::check_dependencies::check_vulnerable_dependencies
227      if: github.event_name == 'pull_request'
228      uses: actions/dependency-review-action@67d4f4bd7a9b17a0db54d2a7519187c65e339de8
229      with:
230        license-check: false
231    timeout-minutes: 60
232  check_workspace_binaries:
233    if: github.repository_owner == 'zed-industries'
234    runs-on: namespace-profile-8x16-ubuntu-2204
235    steps:
236    - name: steps::checkout_repo
237      uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
238      with:
239        clean: false
240    - name: steps::setup_cargo_config
241      run: |
242        mkdir -p ./../.cargo
243        cp ./.cargo/ci-config.toml ./../.cargo/config.toml
244      shell: bash -euxo pipefail {0}
245    - name: steps::setup_linux
246      run: ./script/linux
247      shell: bash -euxo pipefail {0}
248    - name: steps::install_mold
249      run: ./script/install-mold
250      shell: bash -euxo pipefail {0}
251    - name: cargo build -p collab
252      run: cargo build -p collab
253      shell: bash -euxo pipefail {0}
254    - name: cargo build --workspace --bins --examples
255      run: cargo build --workspace --bins --examples
256      shell: bash -euxo pipefail {0}
257    - name: steps::cleanup_cargo_config
258      if: always()
259      run: |
260        rm -rf ./../.cargo
261      shell: bash -euxo pipefail {0}
262    timeout-minutes: 60
263concurrency:
264  group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.ref_name == 'main' && github.sha || 'anysha' }}
265  cancel-in-progress: true