diff --git a/.github/conf/setup.yml b/.github/conf/setup.yml new file mode 100644 index 00000000..f6a0d8e5 --- /dev/null +++ b/.github/conf/setup.yml @@ -0,0 +1,23 @@ +# basic configuration + +- uses: actions/checkout@v3 + with: + fetch-depth: 0 + +- name: Derive appropriate SHAs for base and head for `nx affected` commands + uses: nrwl/nx-set-shas@v3 + with: + main-branch-name: 'master' + +- run: | + echo "BASE: ${{ env.NX_BASE }}" + echo "HEAD: ${{ env.NX_HEAD }}" + +- name: Installing Node.js 19.x + uses: actions/setup-node@v3 + with: + node-version: 19.x + cache: 'yarn' + +- name: Installing dependencies + run: yarn install --frozen-lockfile diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0e79c3d3..a6bc2665 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: CodeGear CI > build +name: code-gear > build on: pull_request: branches: [ master ] @@ -13,47 +13,19 @@ jobs: name: Creating a Production Build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Derive appropriate SHAs for base and head for `nx affected` commands - uses: nrwl/nx-set-shas@v3 - with: - main-branch-name: 'master' - - - run: | - echo "BASE: ${{ env.NX_BASE }}" - echo "HEAD: ${{ env.NX_HEAD }}" - - - name: Installing Node.js 19.x - uses: actions/setup-node@v3 - with: - node-version: 19.x - cache: 'yarn' - - - name: Installing dependencies - run: yarn install --frozen-lockfile + - name: using setup script + uses: ./.github/conf/setup.yml - name: Creating a Production Build - run: | - yarn dlx nx build + run: yarn dlx nx run root:build build-storybook: name: Building and deploying storybook runs-on: ubuntu-latest steps: + - name: using setup script + uses: ./.github/conf/setup.yml - uses: actions/checkout@v3 - - name: Installing Node.js 19.x - uses: actions/setup-node@v3 - with: - node-version: 19.x - cache: 'yarn' - - - name: Installing dependencies - run: yarn install - - name: Building storybook - run: | - yarn dlx nx run ui:storybook:build + run: yarn dlx nx run ui:storybook:build diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index c2a0ba7b..fb4c6743 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -1,4 +1,4 @@ -name: CodeGear CI > build +name: code-gear > build on: pull_request: branches: [ master ] @@ -16,16 +16,8 @@ jobs: name: Pushing workflow to build branch runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - - name: Installing Node.js 19.x - uses: actions/setup-node@v3 - with: - node-version: 19.x - cache: 'yarn' - - - name: Installing dependencies - run: yarn install + - name: using setup script + uses: ./.github/conf/setup.yml - name: Pushing to build branch uses: s0/git-publish-subdir-action@develop @@ -41,16 +33,8 @@ jobs: name: Building and deploying storybook runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - - name: Installing Node.js 19.x - uses: actions/setup-node@v3 - with: - node-version: 19.x - cache: 'yarn' - - - name: Installing dependencies - run: yarn install + - name: using setup script + uses: ./.github/conf/setup.yml - name: Pushing to build-storybook branch uses: JamesIves/github-pages-deploy-action@v4 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 0722f95e..7e23c2b2 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -1,4 +1,4 @@ -name: CodeGear CI > lint +name: code-gear > lint on: pull_request: branches: [ master ] @@ -11,17 +11,8 @@ jobs: name: Linting project runs-on: ubuntu-latest steps: - - - uses: actions/checkout@v3 - - name: Installing Node.js 19.x - uses: actions/setup-node@v3 - with: - node-version: 19.x - cache: 'yarn' - - - name: Installing dependencies - run: yarn install + - name: using setup script + uses: ./.github/conf/setup.yml - name: Linting project - run: | - yarn dlx nx run lint + run: yarn dlx nx run root:lint diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0cff1581..f114e61b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -name: CodeGear CI > tests +name: code-gear > tests on: pull_request: branches: [ master ] @@ -14,28 +14,14 @@ jobs: needs: [build-storybook] runs-on: ubuntu-latest steps: - - - uses: actions/checkout@v3 - - name: Installing Node.js 19.x - uses: actions/setup-node@v3 - with: - node-version: 19.x - cache: 'yarn' - - - name: Installing dependencies - run: yarn install + - name: using setup script + uses: ./.github/conf/setup.yml - name: Testing storybook in production - run: | - yarn dlx nx run ui:storybook:test:production + run: yarn dlx nx run ui:storybook:test:production test: name: testing project runs-on: ubuntu-latest steps: - - - uses: actions/checkout@v3 - - name: Installing Node.js 19.x - uses: actions/setup-node@v3 - with: - node-version: 19.x - cache: 'yarn' + - name: using setup script + uses: ./.github/conf/setup.yml diff --git a/.npmrc b/.npmrc deleted file mode 100644 index b62f950f..00000000 --- a/.npmrc +++ /dev/null @@ -1,3 +0,0 @@ -strict-peer-dependencies=false -auto-install-peers=true -engine-strict = true diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 00000000..3d325430 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +20.8.0