Skip to content

Commit

Permalink
chore: update workflows to use cache and --continue flag (#2049)
Browse files Browse the repository at this point in the history
Signed-off-by: Paul Schultz <pschultz@pobox.com>
  • Loading branch information
schultzp2020 authored Dec 3, 2024
1 parent 8b4cfd5 commit 16746e2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 31 deletions.
26 changes: 10 additions & 16 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'

- name: Setup local Turbo cache
uses: dtinth/setup-github-actions-caching-for-turbo@cc723b4600e40a6b8815b65701d8614b91e2669e # v1
Expand All @@ -52,11 +51,12 @@ jobs:
run: rm app-config.yaml && mv app-config.example.yaml app-config.yaml

- name: Install dependencies
run: |
yarn install
uses: backstage/actions/yarn-install@25145dd4117d50e1da9330e9ed2893bc6b75373e # v0.6.15
with:
cache-prefix: ${{ runner.os }}-v${{ matrix.node-version }}

- name: Build packages
run: yarn run build --concurrency=75% --affected
run: yarn run build --continue --affected

test:
name: Test with Node.js ${{ matrix.node-version }}
Expand All @@ -75,7 +75,6 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'

- name: Setup local Turbo cache
uses: dtinth/setup-github-actions-caching-for-turbo@cc723b4600e40a6b8815b65701d8614b91e2669e # v1
Expand All @@ -84,32 +83,27 @@ jobs:
run: rm app-config.yaml && mv app-config.example.yaml app-config.yaml

- name: Install dependencies
run: |
yarn install
uses: backstage/actions/yarn-install@25145dd4117d50e1da9330e9ed2893bc6b75373e # v0.6.15
with:
cache-prefix: ${{ runner.os }}-v${{ matrix.node-version }}

- name: Run prettier
run: yarn prettier:check --concurrency=75% --affected
run: yarn prettier:check --continue --affected

- name: Run lint
run: yarn run lint:check --concurrency=75% --affected
run: yarn run lint:check --continue --affected

- name: Run monorepo tools
run: yarn run monorepo:check

- name: Run prettier for e2e
run: cd e2e-tests && yarn prettier:check --concurrency=75% --affected

- name: Run lint for e2e
run: cd e2e-tests && yarn run lint:check

- name: Regenerate dockerfiles
run: |
yarn run build:dockerfile; if [[ $(git diff --name-only | grep Dockerfile || true) != "" ]]; then \
echo "ERROR: Workspace is dirty! Must run 'yarn build:dockerfile' and commit changes!"; exit 1; \
fi
- name: Run tests
run: yarn run test --concurrency=75% --affected
run: yarn run test --continue --affected

- name: Verify wrappers
run: yarn workspace dynamic-plugins-utils run test:wrappers
21 changes: 7 additions & 14 deletions .github/workflows/techdocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,27 +43,20 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node
uses: actions/setup-node@v4
- name: Setup Node.js
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
registry-url: 'https://registry.npmjs.org'

- name: Setup local Turbo cache
uses: dtinth/setup-github-actions-caching-for-turbo@v1

- name: Install Dependencies
run: |
yarn install
if [[ $(git diff --name-only . | grep yarn.lock || true) ]]; then
echo "After 'yarn install', workspace is dirty! The following files have changed:"
echo
git diff --name-only . || true
exit 42
fi
- name: Install dependencies
uses: backstage/actions/yarn-install@25145dd4117d50e1da9330e9ed2893bc6b75373e # v0.6.15
with:
cache-prefix: ${{ runner.os }}-v20

- name: Lint
run: |
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/update-backstage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ jobs:
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: yarn install
uses: backstage/actions/yarn-install@25145dd4117d50e1da9330e9ed2893bc6b75373e # v0.6.15
with:
cache-prefix: ${{ runner.os }}-v20

- name: Run versons:bump script
run: |
Expand Down

0 comments on commit 16746e2

Please sign in to comment.