From 9a71b06d1c524f0849360e9c2414e11b7123ecff Mon Sep 17 00:00:00 2001 From: Richard Cox Date: Fri, 9 Aug 2024 15:39:42 +0100 Subject: [PATCH] unit test and lint in gh org runners, setup python via action --- .github/actions/setup/action.yaml | 12 +++++------- .github/setup-node/action.yaml | 17 +++++++++++++++++ .github/workflows/test.yaml | 6 ++++-- 3 files changed, 26 insertions(+), 9 deletions(-) create mode 100644 .github/setup-node/action.yaml diff --git a/.github/actions/setup/action.yaml b/.github/actions/setup/action.yaml index 2f1f02da98..095da7bf85 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 + - uses: actions/setup-python@v5 + with: + python-version: '2.7' - name: Install packages shell: bash diff --git a/.github/setup-node/action.yaml b/.github/setup-node/action.yaml new file mode 100644 index 0000000000..26a67e8257 --- /dev/null +++ b/.github/setup-node/action.yaml @@ -0,0 +1,17 @@ +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: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '14.x' + cache: 'yarn' diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 074ab82189..abdb35e715 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -13,7 +13,8 @@ on: jobs: 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@v3 with: @@ -25,7 +26,8 @@ jobs: - name: Run tests run: yarn test 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@v3 with: