diff --git a/.github/actions/yarn-install-and-verify/action.yml b/.github/actions/yarn-install-and-verify/action.yml new file mode 100644 index 0000000000..5313f7bcc2 --- /dev/null +++ b/.github/actions/yarn-install-and-verify/action.yml @@ -0,0 +1,33 @@ +name: Yarn Install Build Test and Lint + +inputs: + cache_id: + description: ID to use in order to cache yarn install + required: true + working_dir: + description: Directory in which to perform the yarn tasks + required: true + +runs: + using: composite + steps: + - uses: actions/cache@v2 + with: + path: '**/node_modules' + key: ${{ inputs.cache_id }}-${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} + + - name: Install modules + run: yarn install + working-directory: ${{ inputs.working_dir }} + + - name: Build TypeScript + run: yarn build + working-directory: ${{ inputs.working_dir }} + + - name: Test TypeScript + run: yarn test + working-directory: ${{ inputs.working_dir }} + + - name: Lint TypeScript + run: yarn lint + working-directory: ${{ inputs.working_dir }} diff --git a/.github/workflows/sdk-core.yml b/.github/workflows/sdk-core.yml new file mode 100644 index 0000000000..c2c9b66bb8 --- /dev/null +++ b/.github/workflows/sdk-core.yml @@ -0,0 +1,18 @@ +name: SDK Core + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + build-lint-and-test-core: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + - uses: ./.github/actions/yarn-install-and-verify + with: + cache_id: sdk-core + working_dir: ./core/js diff --git a/.github/workflows/yarn-build-and-lint.yml b/.github/workflows/yarn-build-and-lint.yml deleted file mode 100644 index 1bbf3d253a..0000000000 --- a/.github/workflows/yarn-build-and-lint.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: JS Build+Lint All - -on: - push: - branches: [master] - pull_request: - branches: [master] - -jobs: - build-and-lint-js: - - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - - uses: actions/cache@v2 - with: - path: '**/node_modules' - key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }} - - - name: Install modules - run: yarn install - - - name: build-typescript - run: yarn build - - - name: lint-typescript - run: yarn lint