fix(ci): use up-to-date npm version for Trusted Publishers #304
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: npmtest | |
| on: | |
| push: | |
| branches: ["master"] | |
| pull_request: | |
| branches: ["master"] | |
| permissions: | |
| contents: read | |
| jobs: | |
| check_npm_version_ubuntu_24: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node 20.x | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20.x | |
| - name: Check npm version | |
| run: npm --version | |
| check_npm_version_ubuntu_22: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Node 20.x | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20.x | |
| - name: Check npm version | |
| run: npm --version | |
| lint: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - run: npx [email protected] --check . | |
| test: | |
| needs: lint | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| tests: | |
| [ | |
| "containers", | |
| "containers-private", | |
| "deploy", | |
| "domains", | |
| "functions", | |
| "multi-region", | |
| "provider", | |
| "runtimes", | |
| "shared", | |
| "triggers", | |
| ] | |
| node-version: ["18.x", "20.x"] | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up node ${{ matrix.node-version }} | |
| id: setup-node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: "npm" | |
| - name: Install Serverless Framework | |
| run: npm install -g [email protected] | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run tests | |
| run: npm run test:${{ matrix.tests }} | |
| env: | |
| SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY }} | |
| SCW_REGION: ${{ vars.SCW_REGION }} | |
| SCW_ORGANIZATION_ID: ${{ secrets.SCW_ORGANIZATION_ID }} | |
| clean-up: | |
| if: ${{ always() }} | |
| needs: test | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up node 20.x | |
| id: setup-node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20.x | |
| cache: "npm" | |
| - name: Install Serverless Framework | |
| run: npm install -g [email protected] | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run cleanup | |
| run: npm run clean-up | |
| env: | |
| SCW_SECRET_KEY: ${{ secrets.SCW_SECRET_KEY }} | |
| SCW_ORGANIZATION_ID: ${{ secrets.SCW_ORGANIZATION_ID }} |