Skip to content

update GHA for ci2

update GHA for ci2 #10

Workflow file for this run

name: CI-testing
on:
push:
branches:
- main
pull_request:
jobs:
test:
strategy:
matrix:
node-version: [20.x, 21.x]
os: [ubuntu-latest, macOS-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 8
- name: pnpm install and test
run: |
pnpm install
pnpm test:coverage
env:
CI: true
# - name: Update coverage
# run: |
# npm run codecov -- -t ${{ secrets.CODECOV_TOKEN }}
build-artifacts:
needs: test
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
name: Install pnpm
with:
version: 8
- name: Install dependencies
run: pnpm install
- name: Create artifact
run: |
./build.sh package
npm pack
mv ./gauge-typescript-*.tgz ./artifacts
- name: Upload artifacts for local
uses: actions/upload-artifact@v3
with:
name: gauge-typescript
path: ./artifacts
sample-project:
needs: build-artifacts
strategy:
matrix:
node-version: [20.x, 21.x]
os: [macOS-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: getgauge/setup-gauge@master
with:
gauge-version: '1.6.4'
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- uses: actions/download-artifact@v3
with:
name: gauge-typescript
path: ./artifacts
- name: Install gauge-typescript
run: |
gauge install typescript -f ./artifacts/gauge-typescript-*.zip
shell: bash
- name: Initialize a sample project
run: |
mkdir sample
cd sample
gauge init https://github.com/tkitsunai/gauge-template-typescript/archive/refs/tags/v0.1.1.zip
npm install ../artifacts/gauge-typescript-*.tgz
shell: bash