|
1 | | -name: Testing |
| 1 | +name: Test |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
|
10 | 10 | - dev |
11 | 11 |
|
12 | 12 | jobs: |
13 | | - test: |
14 | | - name: Testing |
| 13 | + branch: |
| 14 | + name: Get branch name |
15 | 15 | runs-on: ubuntu-latest |
16 | 16 |
|
17 | 17 | steps: |
18 | 18 | - name: Checkout |
19 | | - uses: actions/checkout@v3 |
| 19 | + uses: actions/checkout@v4 |
| 20 | + |
| 21 | + - name: Extract Branch Name by Push |
| 22 | + if: github.event_name != 'pull_request' |
| 23 | + run: | |
| 24 | + BRANCH_NAME=${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}} |
| 25 | + echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV |
| 26 | +
|
| 27 | + - name: Extract Branch Name by PR |
| 28 | + if: github.event_name == 'pull_request' |
| 29 | + run: | |
| 30 | + BRANCH_NAME=${GITHUB_BASE_REF:-${GITHUB_HEAD_REF}} |
| 31 | + echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV |
| 32 | +
|
| 33 | + outputs: |
| 34 | + branch_name: ${{ env.BRANCH_NAME }} |
| 35 | + |
| 36 | + build: |
| 37 | + needs: |
| 38 | + - branch |
| 39 | + |
| 40 | + name: Install dependencies, testing and build |
| 41 | + runs-on: ubuntu-latest |
| 42 | + |
| 43 | + strategy: |
| 44 | + matrix: |
| 45 | + node-version: [22.x] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ |
| 46 | + |
| 47 | + steps: |
| 48 | + - name: Checkout |
| 49 | + uses: actions/checkout@v4 |
20 | 50 |
|
21 | 51 | - name: Install Node.js |
22 | | - uses: actions/setup-node@v3 |
| 52 | + uses: actions/setup-node@v4 |
23 | 53 | with: |
24 | | - node-version: 18 # - get from package.json: engines.node |
| 54 | + node-version: 22 # - get from package.json: engines.node |
25 | 55 | registry-url: 'https://registry.npmjs.org' |
26 | 56 |
|
27 | | - - uses: pnpm/action-setup@v2 |
| 57 | + - uses: pnpm/action-setup@v4 |
28 | 58 | name: Install pnpm |
29 | 59 | id: pnpm-install |
30 | 60 | with: |
31 | | - version: 8 # - get from package.json: engines.pnpm |
| 61 | + version: 9 # - get from package.json: engines.pnpm |
32 | 62 | run_install: false |
33 | 63 |
|
34 | 64 | - name: Get pnpm store directory |
|
37 | 67 | run: | |
38 | 68 | echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT |
39 | 69 |
|
40 | | - - uses: actions/cache@v3 |
| 70 | + - uses: actions/cache@v4 |
41 | 71 | name: Setup pnpm cache |
42 | 72 | with: |
43 | 73 | path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} |
|
49 | 79 | run: node -v && pnpm -v && pnpm install --frozen-lockfile |
50 | 80 |
|
51 | 81 | - name: Test |
52 | | - run: npm run test:ci |
| 82 | + run: pnpm test:ci |
0 commit comments