diff --git a/.github/actions/setup-chrome/action.yaml b/.github/actions/setup-chrome/action.yaml new file mode 100644 index 0000000000..7315bb34d6 --- /dev/null +++ b/.github/actions/setup-chrome/action.yaml @@ -0,0 +1,15 @@ +name: Setup Chrome +description: Setup Chrome + +runs: + using: 'composite' + steps: + - name: Install chrome + shell: bash + run: | + zypper addrepo http://dl.google.com/linux/chrome/rpm/stable/x86_64 Google-Chrome + curl https://dl.google.com/linux/linux_signing_key.pub + rpm --import linux_signing_key.pub + zypper -n refresh + zypper install --no-confirm google-chrome-stable + google-chrome --version diff --git a/.github/actions/setup-node/action.yaml b/.github/actions/setup-node/action.yaml new file mode 100644 index 0000000000..74bf26be45 --- /dev/null +++ b/.github/actions/setup-node/action.yaml @@ -0,0 +1,21 @@ +name: Setup Node +description: Setup node, including yarn + +runs: + using: 'composite' + steps: + - name: Install yarn + shell: bash + run: | + 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: Ensure repo dir is accepted as safe by git (diff user) + shell: bash + run: | + git config --global --add safe.directory $PWD + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '14.x' + cache: 'yarn' diff --git a/.github/actions/setup/action.yaml b/.github/actions/setup/action.yaml index 2f1f02da98..f625877ef2 100644 --- a/.github/actions/setup/action.yaml +++ b/.github/actions/setup/action.yaml @@ -4,14 +4,12 @@ description: Setup node, python and call bootstrap script runs: using: 'composite' steps: - - uses: actions/setup-node@v3 - with: - node-version: '14.x' + - name: Setup Node + uses: ./.github/actions/setup-node - - name: Install Python for node-sass - shell: bash - run: | - DEBIAN_FRONTEND=noninteractive sudo apt-get install -y --no-install-recommends python2 + # We don't need to install python (for node-sass) as the base image contains it + # Note - we're on bci, so no apt-get, though there is zypper... + # Note - we're on bci, is not supported by actions/setup-python - name: Install packages shell: bash diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 074ab82189..cfb331c013 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -13,25 +13,30 @@ on: jobs: unit-test: - runs-on: ubuntu-latest + container: registry.suse.com/bci/python:3.12 + runs-on: org-${{ github.repository_owner_id }}-amd64-k8s steps: - uses: actions/checkout@v3 with: fetch-depth: 1 - - name: Run Setup + - name: Setup uses: ./.github/actions/setup + - name: Setup Chrome + uses: ./.github/actions/setup-chrome + - name: Run tests run: yarn test lint: - runs-on: ubuntu-latest + container: registry.suse.com/bci/python:3.12 + runs-on: org-${{ github.repository_owner_id }}-amd64-k8s steps: - uses: actions/checkout@v3 with: fetch-depth: 1 - - name: Run Setup + - name: Setup uses: ./.github/actions/setup - name: Run linter