From 1977725957a55f15cd1834a6e0bd6c1522f3b4c0 Mon Sep 17 00:00:00 2001 From: Francesco Torchia Date: Tue, 5 Nov 2024 10:59:07 +0100 Subject: [PATCH] Add CI step: lint Signed-off-by: Francesco Torchia --- .github/actions/lint/action.yaml | 12 +++++++++++ .github/actions/setup/action.yaml | 14 +++++++++++++ .github/workflows/build-extension-charts.yml | 11 ++++++++++ .github/workflows/test.yaml | 21 ++++++++++++++++++++ .gitignore | 3 --- 5 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 .github/actions/lint/action.yaml create mode 100644 .github/actions/setup/action.yaml create mode 100644 .github/workflows/test.yaml diff --git a/.github/actions/lint/action.yaml b/.github/actions/lint/action.yaml new file mode 100644 index 00000000..77895a3c --- /dev/null +++ b/.github/actions/lint/action.yaml @@ -0,0 +1,12 @@ +name: Run Lint +description: Run Lint + +runs: + using: 'composite' + steps: + - name: Setup env + uses: ./.github/actions/setup + + - name: Run linters + shell: bash + run: yarn lint diff --git a/.github/actions/setup/action.yaml b/.github/actions/setup/action.yaml new file mode 100644 index 00000000..fa6d2458 --- /dev/null +++ b/.github/actions/setup/action.yaml @@ -0,0 +1,14 @@ +name: Setup UI Env +description: Setup node and install dependencies + +runs: + using: 'composite' + steps: + - uses: actions/setup-node@v4 + with: + node-version-file: '.nvmrc' + cache: 'yarn' + + - name: Install packages + shell: bash + run: yarn install diff --git a/.github/workflows/build-extension-charts.yml b/.github/workflows/build-extension-charts.yml index 50bdfadf..3e1d3bc2 100644 --- a/.github/workflows/build-extension-charts.yml +++ b/.github/workflows/build-extension-charts.yml @@ -11,7 +11,18 @@ defaults: working-directory: ./ jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Run tests + uses: ./.github/actions/lint build-extension-charts: + needs: + - lint uses: rancher/dashboard/.github/workflows/build-extension-charts.yml@master permissions: actions: write diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 00000000..cfd7e7a2 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,21 @@ +name: Tests +on: + push: + branches: + - main + - 'release-*' + pull_request: + branches: + - main + - 'release-*' + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Run tests + uses: ./.github/actions/lint diff --git a/.gitignore b/.gitignore index 2212a6b3..71c1a9fd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,3 @@ -dev -lint - # rancher shell .shell