From fc8d01b6c070be002466598b1878407774f33de3 Mon Sep 17 00:00:00 2001 From: Alex Rudenko Date: Thu, 11 Sep 2025 12:57:41 +0200 Subject: [PATCH] ci: re-configure ci --- .github/workflows/check-format.yml | 16 +++++++++------- .github/workflows/run-tests.yml | 18 +++++++++++------- .nvmrc | 1 + 3 files changed, 21 insertions(+), 14 deletions(-) create mode 100644 .nvmrc diff --git a/.github/workflows/check-format.yml b/.github/workflows/check-format.yml index 268783db..68a680e6 100644 --- a/.github/workflows/check-format.yml +++ b/.github/workflows/check-format.yml @@ -1,4 +1,4 @@ -name: Check Code Format +name: Check code format permissions: read-all @@ -13,17 +13,19 @@ jobs: runs-on: ubuntu-latest # You can also use 'macos-latest' or 'windows-latest' steps: - - name: Checkout code - uses: actions/checkout@v4 # Use the latest stable version + - name: Check out repository + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + fetch-depth: 2 - name: Set up Node.js - uses: actions/setup-node@v4 # Use the latest stable version + uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 with: - node-version: '22' # Specify the Node.js version your project uses (e.g., '18', '20', '22') - cache: 'npm' # Caches npm dependencies to speed up builds + cache: npm + node-version-file: '.nvmrc' - name: Install dependencies - run: npm ci # Use 'npm ci' for clean installs in CI environments, or 'npm install' if you prefer + run: npm ci - name: Run format check run: npm run check-format diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index b2287ff4..8f2cb3b8 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -9,23 +9,27 @@ on: pull_request: jobs: - tests: + run-tests: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v4 + - name: Check out repository + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + fetch-depth: 2 - name: Set up Node.js - uses: actions/setup-node@v4 + uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0 with: - node-version: '22' - cache: 'npm' + cache: npm + node-version-file: '.nvmrc' - name: Install dependencies run: npm ci - # Ensure the project compiles properly. + - name: Disable AppArmor + run: echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns + - name: Build the project run: npm run build diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 00000000..92f279e3 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +v22 \ No newline at end of file