Skip to content

Commit

Permalink
ci: get yarn version
Browse files Browse the repository at this point in the history
Signed-off-by: Ourchitecture.io <[email protected]>
  • Loading branch information
ourchitectureio committed Nov 3, 2023
1 parent 55e3bed commit 9249533
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/ourstage-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,31 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Get npm version
id: npm-version
shell: bash
run: echo "NPM_VERSION=$(cat ./.npmrc)" >> $GITHUB_OUTPUT

- name: Get yarn version
id: yarn-version
shell: bash
working-directory: ./src/backstage/ourstage/
run: cat ./package.json | jq -r .packageManager | sed 's\yarn@\\g' | xargs -I {} -n 1 echo 'YARN_VERSION={}' >> $GITHUB_OUTPUT

- uses: actions/setup-node@v3
id: node-install
with:
node-version-file: './.nvmrc'
cache: 'yarn'
cache-dependency-path: './src/backstage/ourstage/**/yarn.lock'

- name: Install npm and yarn
id: npm-and-yarn-install
run: |
npm install --location=global \
npm@${{ steps.npm-version.outputs.NPM_VERSION }} \
yarn@${{ steps.yarn-version.outputs.YARN_VERSION }}
- name: Make
id: make
working-directory: ./src/backstage/ourstage/
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/repo-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Get npm version
id: npm-version
shell: bash
run: echo "NPM_VERSION=$(cat ./.npmrc)" >> $GITHUB_OUTPUT

- name: Get pnpm version
id: pnpm-version
shell: bash
Expand All @@ -41,6 +46,10 @@ jobs:
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'

- name: Install npm
id: npm-install
run: npm install --location=global npm@${{ steps.npm-version.outputs.NPM_VERSION }}

- name: Setup Wireit cache
id: cache-wireit
uses: google/wireit@setup-github-actions-caching/v1
Expand Down
5 changes: 5 additions & 0 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,8 @@ reset: clean
sync:
@git-town sync
@gh run watch

.PHONY: workflows
workflows:
@gh workflow view repo-tests
@gh workflow view ourstage-tests
5 changes: 5 additions & 0 deletions src/backstage/ourstage/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
# Ourchitecture developers use local Nexus package registries and URLs.
# However, classic Yarn versions include the registry URL in the "yarn.lock"
# lock file. So, this configuration explicitly uses the public registry to
# generate a lock file that can be shared across machines including DevOps
# pipelines.
npmRegistryServer: "https://registry.yarnpkg.com"

0 comments on commit 9249533

Please sign in to comment.