Skip to content

Merge pull request #1848 from polywrap/prep-0.11.1 #877

Merge pull request #1848 from polywrap/prep-0.11.1

Merge pull request #1848 from polywrap/prep-0.11.1 #877

name: CI-Javascript
on:
push:
branches:
- origin
- origin-dev
pull_request:
jobs:
Lint-and-Build:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Read .nvmrc
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
id: nvm
- name: Setup Node.js
uses: actions/setup-node@master
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --nonInteractive --frozen-lockfile --prefer-offline
- name: Lint
run: yarn run lint:ci
- name: Build
run: yarn build
Build-Docs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Read .nvmrc
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
id: nvm
- name: Setup Node.js
uses: actions/setup-node@master
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --nonInteractive --frozen-lockfile --prefer-offline
- name: Build
run: yarn build
- name: Build docs
run: yarn build:docs
CI-WRAP-Test-Harness:
uses: ./.github/workflows/ci-wrap-test-harness.yaml
Test-Templates:
runs-on: ubuntu-latest
timeout-minutes: 60
if: ${{ always() }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Read .nvmrc
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
id: nvm
- name: Setup Node.js
uses: actions/setup-node@master
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Setup Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: '1.4.2'
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '^1.13.1'
- name: Install cue lang
run: go install cuelang.org/go/cmd/cue@latest
- name: Check if cue is installed
run: cue version
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --nonInteractive --frozen-lockfile --prefer-offline
- name: Build
run: yarn build
- name: Test
run: yarn test:templates
Test-Core:
runs-on: ubuntu-latest
timeout-minutes: 60
if: ${{ always() }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Read .nvmrc
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
id: nvm
- name: Setup Node.js
uses: actions/setup-node@master
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Setup Poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: '1.4.2'
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: '^1.13.1'
- name: Install cue lang
run: go install cuelang.org/go/cmd/cue@latest
- name: Check if cue is installed
run: cue version
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --nonInteractive --frozen-lockfile --prefer-offline
- name: Build
run: yarn build
- name: Test
run: yarn test:core
Test-Cli:
runs-on: ubuntu-latest
needs: CI-WRAP-Test-Harness
if: ${{ always() }}
timeout-minutes: 60
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Read .nvmrc
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
id: nvm
- name: Setup Node.js
uses: actions/setup-node@master
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
- uses: actions/setup-go@v3
with:
go-version: '^1.13.1'
- name: Install cue lang
run: go install cuelang.org/go/cmd/cue@latest
- name: Check if cue is installed
run: cue version
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn install --nonInteractive --frozen-lockfile --prefer-offline
- name: Build
run: yarn build
- name: Get updated wrappers
if: ${{ needs.CI-WRAP-Test-Harness.outputs.rebuild_required == 'true' }}
uses: actions/download-artifact@v3
id: get-wrappers
with:
name: rebuilt-wrappers
path: ./wrappers
- if: ${{ needs.CI-WRAP-Test-Harness.outputs.rebuild_required == 'true' }}
run: |
rm -rf packages/test-cases/cases/wrappers
mv wrappers packages/test-cases/cases
- name: Test cli:unit
run: yarn test:unit
working-directory: ./packages/cli
- name: Test cli:e2e:p1
run: yarn test:e2e:p1
working-directory: ./packages/cli
- name: Test cli:e2e:p2
run: yarn test:e2e:p2
working-directory: ./packages/cli
- name: Test CLI JS
run: yarn test
working-directory: ./packages/js/cli