Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use org runners for workflows that run in PR gates #11616

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/actions/setup-node/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Setup Node
description: Setup node, including yarn

runs:
using: 'composite'
steps:
- name: Setup yarn
shell: bash
# if we have yarn, no op
# if no yarn, install (probably running in non-containerized runners)
run: |
yarn || curl -fsSL -o ~/bin/yarn https://github.com/yarnpkg/yarn/releases/download/v1.22.17/yarn-1.22.17.js && chmod +x ~/bin/yarn && echo "~/bin" >> $GITHUB_PATH

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
8 changes: 3 additions & 5 deletions .github/actions/setup/action.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
name: Setup UI Env
description: Setup node, python and call bootstrap script
description: Setup node, yarn install

runs:
using: 'composite'
steps:
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Setup Node
uses: ./.github/actions/setup-node

- name: Install packages
shell: bash
Expand Down
13 changes: 4 additions & 9 deletions .github/workflows/check-plugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,14 @@ env:
TEST_PERSIST_BUILD: true
jobs:
validate:
runs-on: ubuntu-latest
# Resource starved when running in container, so run in non-container runner
runs-on: runs-on,runner=8cpu-linux-x64,run-id=${{ github.run_id }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Enable Corepack
run: corepack enable

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- name: Setup Node
uses: ./.github/actions/setup-node

- name: Validate Plugin build system
run: ./shell/scripts/test-plugins-build.sh
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/docusaurus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@ on:
jobs:
build:
name: Build
runs-on: ubuntu-latest
container: registry.suse.com/bci/nodejs:20
runs-on: org-${{ github.repository_owner_id }}-amd64-k8s
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: yarn

- name: Setup Node
uses: ./.github/actions/setup-node
- name: Install dependencies
run: cd docusaurus/ && yarn install:ci
- name: Build website
Expand All @@ -38,7 +36,8 @@ jobs:
deploy:
name: Publish
if: ${{ github.event_name == 'push' && github.repository_owner == 'rancher' }}
runs-on: ubuntu-latest
container: registry.suse.com/bci/nodejs:20
runs-on: org-${{ github.repository_owner_id }}-amd64-k8s
needs: build

# This is required to avoid https://github.com/actions/deploy-pages/issues/271
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pr-gh-project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ jobs:
pull-requests: write
repository-projects: write
id-token: write
runs-on: ubuntu-latest
container: registry.suse.com/bci/nodejs:20
runs-on: org-${{ github.repository_owner_id }}-amd64-k8s
steps:
- uses: actions/checkout@v2
- name: Use Node.js
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/storybook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,12 @@ on:
- master
jobs:
storybook:
runs-on: ubuntu-latest
container: registry.suse.com/bci/nodejs:20
runs-on: org-${{ github.repository_owner_id }}-amd64-k8s
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Setup Node
uses: ./.github/actions/setup-node
- name: Install packages
run: yarn install
- name: Build Storybook
Expand Down
69 changes: 38 additions & 31 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,19 @@ env:
jobs:
e2e-ui-build:
if: "!contains( github.event.pull_request.labels.*.name, 'ci/skip-e2e')"
runs-on: ubuntu-latest
container: registry.suse.com/bci/nodejs:20
runs-on: org-${{ github.repository_owner_id }}-amd64-k8s
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup env
uses: ./.github/actions/setup
- name: Ensure repo dir is accepted as safe by git
# in bci user who runs git commands and repo folder owner is different
shell: bash
run: |
git config --global --add safe.directory $PWD
- name: Build e2e
run: yarn e2e:build
- name: Upload e2e build
Expand All @@ -61,15 +67,16 @@ jobs:
retention-days: 10
compression-level: 9


e2e-test:
if: "!contains( github.event.pull_request.labels.*.name, 'ci/skip-e2e')"
needs: e2e-ui-build
# Cannot run container (rancher) in container (runner), so run in non-container runner
runs-on: runs-on,runner=8cpu-linux-x64,run-id=${{ github.run_id }}
strategy:
fail-fast: false
matrix:
role: [
{ username: 'admin', tag: '@adminUser' },
{ username: 'admin', tag: '@adminUser' },
{ username: 'standard_user', tag: '@standardUser' }
]
features: [
Expand All @@ -84,23 +91,23 @@ jobs:
['@components'],
['@vai']
]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Setup env
uses: ./.github/actions/setup

# Installing fixed version of Chrome since latest version does not work (128 didn't work)
# Leaving this here again in case we need to pin to a specific Chrome version in the future
- name: Install Chrome 127
run: |
sudo apt-get install -y wget
cd /tmp
wget -q http://mirror.cs.uchicago.edu/google-chrome/pool/main/g/google-chrome-stable/google-chrome-stable_127.0.6533.72-1_amd64.deb
sudo apt-get install -y --allow-downgrades ./google-chrome-stable_127.0.6533.72-1_amd64.deb
google-chrome --version
# # Installing fixed version of Chrome since latest version does not work (128 didn't work)
# # Leaving this here again in case we need to pin to a specific Chrome version in the future
# - name: Install Chrome 127
# run: |
# sudo apt-get install -y wget
# cd /tmp
# wget -q http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_127.0.6533.72-1_amd64.deb
# sudo apt-get install -y --allow-downgrades ./google-chrome-stable_127.0.6533.72-1_amd64.deb
# google-chrome --version

- name: Download e2e build
uses: actions/download-artifact@v4
Expand All @@ -119,15 +126,15 @@ jobs:
- name: Setup Rancher and user
run: |
yarn e2e:prod
env:
env:
GREP_TAGS: ${{ matrix.role.tag }}Setup+${{ matrix.features[0] }} --@jenkins ${{ matrix.role.tag }}Setup+${{ matrix.features[1] || matrix.features[0] }} --@jenkins
TEST_USERNAME: admin
TEST_ONLY: setup
- name: Run user tests
run: |
yarn e2e:prod
[ "$BUILD_DASHBOARD" != "false" ] || exit 0
env:
env:
TEST_SKIP: setup
GREP_TAGS: ${{ matrix.role.tag }}+${{ matrix.features[0] }} --@jenkins ${{ matrix.role.tag }}+${{ matrix.features[1] || matrix.features[0] }} --@jenkins
TEST_USERNAME: ${{ matrix.role.username }}
Expand All @@ -139,9 +146,9 @@ jobs:
name: ${{github.run_number}}-${{github.run_attempt}}-screenshots-${{ matrix.role.tag }}+${{ matrix.features[0] }}
path: cypress/screenshots


unit-test:
runs-on: ubuntu-latest
container: registry.suse.com/bci/nodejs:20
runs-on: org-${{ github.repository_owner_id }}-amd64-k8s
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -162,9 +169,9 @@ jobs:
name: ${{github.run_number}}-${{github.run_attempt}}-coverage
path: coverage-artifacts/**/*


i18n:
runs-on: ubuntu-latest
container: registry.suse.com/bci/nodejs:20
runs-on: org-${{ github.repository_owner_id }}-amd64-k8s
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -173,9 +180,9 @@ jobs:
- name: Run i18n lint
uses: ./.github/actions/i18n-lint


lint:
runs-on: ubuntu-latest
container: registry.suse.com/bci/nodejs:20
runs-on: org-${{ github.repository_owner_id }}-amd64-k8s
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -184,16 +191,15 @@ jobs:
- name: Run tests
uses: ./.github/actions/lint


check-i18n:
runs-on: ubuntu-latest
container: registry.suse.com/bci/nodejs:20
runs-on: org-${{ github.repository_owner_id }}-amd64-k8s
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Setup Node
uses: ./.github/actions/setup-node

- name: Install packages
run: yarn install:ci
Expand All @@ -204,14 +210,14 @@ jobs:
./scripts/check-i18n -s -x

check-i18n-links:
runs-on: ubuntu-latest
container: registry.suse.com/bci/nodejs:20
runs-on: org-${{ github.repository_owner_id }}-amd64-k8s
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
- name: Setup Node
uses: ./.github/actions/setup-node

- name: Install packages
run: yarn install:ci
Expand Down Expand Up @@ -245,7 +251,8 @@ jobs:
# run: ./codecov --verbose upload-process -t ${{ secrets.CODECOV_TOKEN }} -n ${{github.run_number}}-${{github.run_attempt}}-coverage -F unit -f ./coverage/coverage-unit.json

check-e2e-tags:
runs-on: ubuntu-latest
container: registry.suse.com/bci/nodejs:20
runs-on: org-${{ github.repository_owner_id }}-amd64-k8s
steps:
- uses: actions/checkout@v4
with:
Expand Down
10 changes: 8 additions & 2 deletions cypress/e2e/po/components/sortable-table.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,17 @@ export default class SortableTablePo extends ComponentPo {
* @param searchText
* @returns
*/
filter(searchText: string) {
return this.filterComponent()
filter(searchText: string, checkQuery = false) {
const res = this.filterComponent()
.focus()
.clear()
.type(searchText);

if (checkQuery) {
cy.url().should('include', `q=${ searchText }`);
}

return res;
}

resetFilter() {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/po/pages/explorer/config-map.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export class ConfigMapPagePo extends PagePo {
}

searchForConfigMap(name: string) {
return this.list().resourceTable().sortableTable().filter(name);
return this.list().resourceTable().sortableTable().filter(name, true);
}

title() {
Expand Down
2 changes: 1 addition & 1 deletion cypress/e2e/po/pages/explorer/network-policy.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ export class NetworkPolicyPagePo extends PagePo {
}

searchForNetworkPolicy(name: string) {
return this.list().resourceTable().sortableTable().filter(name);
return this.list().resourceTable().sortableTable().filter(name, true);
}
}
7 changes: 6 additions & 1 deletion shell/scripts/test-plugins-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ if [ "${SKIP_STANDALONE}" == "false" ]; then
pushd test-app > /dev/null

yarn install
FORCE_COLOR=true yarn build | cat

echo "Building skeleton app"

NODE_OPTIONS=--max_old_space_size=4096 FORCE_COLOR=true yarn build | cat

# Add test list component to the test package
# Validates rancher-components imports
Expand Down Expand Up @@ -228,3 +231,5 @@ function clone_repo_test_extension_build() {
# clone_repo_test_extension_build "capi-ui-extension" "capi"

echo "All done"
# Force an exit
exit 0
Loading