Skip to content

Commit 6547852

Browse files
committed
unit test and lint in gh org runners, setup python via action
1 parent 30e2cec commit 6547852

File tree

3 files changed

+30
-13
lines changed

3 files changed

+30
-13
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Setup Node
2+
description: Setup node, including yarn
3+
4+
runs:
5+
using: 'composite'
6+
steps:
7+
- name: Install yarn
8+
shell: bash
9+
run: |
10+
curl -fsSL -o ~/bin/yarn https://github.com/yarnpkg/yarn/releases/download/v1.22.17/yarn-1.22.17.js
11+
chmod +x ~/bin/yarn
12+
echo "~/bin" >> $GITHUB_PATH
13+
- name: Setup Node.js
14+
uses: actions/setup-node@v4
15+
with:
16+
node-version: '14.x'
17+
cache: 'yarn'

.github/actions/setup/action.yaml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,12 @@ description: Setup node, python and call bootstrap script
44
runs:
55
using: 'composite'
66
steps:
7-
- uses: actions/setup-node@v3
8-
with:
9-
node-version: '14.x'
7+
- name: Setup Node
8+
uses: ./.github/actions/setup-node
109

11-
- name: Install Python for node-sass
12-
shell: bash
13-
run: |
14-
DEBIAN_FRONTEND=noninteractive sudo apt-get install -y --no-install-recommends python2
10+
- uses: actions/setup-python@v5
11+
with:
12+
python-version: '2.7'
1513

1614
- name: Install packages
1715
shell: bash

.github/workflows/test.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,26 +13,28 @@ on:
1313

1414
jobs:
1515
unit-test:
16-
runs-on: ubuntu-latest
16+
container: registry.suse.com/bci/nodejs:20
17+
runs-on: org-${{ github.repository_owner_id }}-amd64-k8s
1718
steps:
1819
- uses: actions/checkout@v3
1920
with:
2021
fetch-depth: 1
2122

22-
- name: Run Setup
23-
uses: ./.github/actions/setup
23+
- name: Setup Node
24+
uses: ./.github/actions/setup-node
2425

2526
- name: Run tests
2627
run: yarn test
2728
lint:
28-
runs-on: ubuntu-latest
29+
container: registry.suse.com/bci/nodejs:20
30+
runs-on: org-${{ github.repository_owner_id }}-amd64-k8s
2931
steps:
3032
- uses: actions/checkout@v3
3133
with:
3234
fetch-depth: 1
3335

34-
- name: Run Setup
35-
uses: ./.github/actions/setup
36+
- name: Setup Node
37+
uses: ./.github/actions/setup-node
3638

3739
- name: Run linter
3840
run: yarn lint:js

0 commit comments

Comments
 (0)