DRIVERS-3590 Improve dev workflow #2519
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: "Tests" | |
| on: | |
| pull_request: | |
| branches: | |
| - "master" | |
| push: | |
| branches: | |
| - "master" | |
| concurrency: | |
| group: tests-${{ github.ref }} | |
| cancel-in-progress: true | |
| defaults: | |
| run: | |
| shell: bash -eux {0} | |
| jobs: | |
| tests: | |
| name: "Tests" | |
| runs-on: ${{ matrix.os }} | |
| timeout-minutes: 10 | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - "ubuntu-latest" | |
| - "ubuntu-22.04" | |
| - "windows-latest" | |
| - "macos-latest" | |
| mongodb-version: | |
| - "8.0" | |
| topology: | |
| - "server" | |
| - "replica_set" | |
| - "sharded_cluster" | |
| auth: | |
| - "noauth" | |
| - "auth" | |
| ssl: | |
| - "nossl" | |
| - "ssl" | |
| local-atlas: | |
| - "" | |
| include: | |
| - os: "ubuntu-latest" | |
| mongodb-version: "latest" | |
| local-atlas: "1" | |
| - os: "ubuntu-latest" | |
| mongodb-version: "8.0" | |
| local-atlas: "1" | |
| steps: | |
| - name: "Checkout" | |
| uses: "actions/checkout@v7" | |
| with: | |
| fetch-depth: 2 | |
| - id: setup-mongodb | |
| name: "Run GitHub Action" | |
| uses: ./ | |
| with: | |
| version: ${{ matrix.mongodb-version }} | |
| topology: ${{ matrix.topology }} | |
| auth: ${{ matrix.auth }} | |
| ssl: ${{ matrix.ssl }} | |
| local-atlas: ${{ matrix.local-atlas }} | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - id: test-mongodb | |
| name: "Test GitHub Action" | |
| run: | | |
| MONGOSH_EXTRA_ARGS="" | |
| if [ ${{ matrix.ssl }} == "ssl" ] && [ -z "${{ matrix.local-atlas }}" ]; then | |
| MONGOSH_EXTRA_ARGS="--tls --tlsCertificateKeyFile $(pwd)/.evergreen/x509gen/client.pem --tlsCAFile $(pwd)/.evergreen/x509gen/ca.pem" | |
| fi | |
| export MONGOSH_EXTRA_ARGS | |
| make test-connect | |
| pre-commit: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-python@v7 | |
| - uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 | |
| eslint: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-node@v7 | |
| - id: cache-restore | |
| uses: actions/cache@v6 | |
| with: | |
| path: ./.evergreen/github_app/node_modules | |
| key: npm-${{ hashFiles('./.evergreen/github_app/package-lock.json') }} | |
| - name: Install dependencies | |
| if: steps.cache-restore.outputs.cache-hit != 'true' | |
| working-directory: .evergreen/github_app | |
| run: npm ci - ignore-scripts | |
| - name: Lint | |
| working-directory: .evergreen/github_app | |
| run: npm run lint |