test #4
Workflow file for this run
This file contains 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: Build and deploy | ||
on: | ||
push: | ||
tags: | ||
- "*.*.*" | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 5 | ||
env: | ||
NODE_VERSION: 22 | ||
steps: | ||
- name: Сheckout repo | ||
uses: actions/checkout@v4 | ||
- name: Use Node.js ${{ env.NODE_VERSION }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.NODE_VERSION }} | ||
- name: Cache node modules | ||
uses: actions/cache@v4 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- name: Set RELEASE_VERSION env | ||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Install builder | ||
run: sudo npm install typescript tslint -g | ||
- name: Run linter | ||
run: npm run lint | ||
- name: Run builder | ||
run: npm run build | ||
- name: Archiving lib directory | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: lib | ||
path: ${{ github.workspace }}/lib | ||
test: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
needs: build | ||
strategy: | ||
matrix: | ||
node-version: [20.x, 22.x] | ||
steps: | ||
- name: Сheckout repo | ||
uses: actions/checkout@v4 | ||
- name: Unarchiving lib directory | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: lib | ||
path: ${{ github.workspace }}/lib | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Cache node modules | ||
uses: actions/cache@v4 | ||
env: | ||
cache-name: cache-node-modules | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ env.cache-name }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Run test | ||
run: npm run cov | ||
deploy: | ||
if: ${{ !endsWith(env.RELEASE_VERSION, '-beta') }} | ||
Check failure on line 80 in .github/workflows/build-and-deploy.yml GitHub Actions / Build and deployInvalid workflow file
|
||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
needs: [build, test] | ||
env: | ||
NODE_VERSION: 22 | ||
steps: | ||
- run: echo $RELEASE_VERSION |