Skip to content

Commit

Permalink
unit test and lint in gh org runners, setup python via action
Browse files Browse the repository at this point in the history
  • Loading branch information
richard-cox committed Aug 9, 2024
1 parent 30e2cec commit 6547852
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 13 deletions.
17 changes: 17 additions & 0 deletions .github/actions/setup-node/action.yaml
Original file line number Diff line number Diff line change
@@ -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'
12 changes: 5 additions & 7 deletions .github/actions/setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 8 additions & 6 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,28 @@ 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:
fetch-depth: 1

- name: Run Setup
uses: ./.github/actions/setup
- name: Setup Node
uses: ./.github/actions/setup-node

- 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:
fetch-depth: 1

- name: Run Setup
uses: ./.github/actions/setup
- name: Setup Node
uses: ./.github/actions/setup-node

- name: Run linter
run: yarn lint:js

0 comments on commit 6547852

Please sign in to comment.