Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ jobs:
run: echo "rust-version=$(grep '^rust ' .tool-versions | awk '{print $2}')" >> $GITHUB_OUTPUT
shell: bash

- name: Retrieve Node.js version
id: node-version
run: echo "node-version=$(grep '^nodejs ' .tool-versions | awk '{print $2}')" >> $GITHUB_OUTPUT
shell: bash

- name: Set up rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
Expand All @@ -29,6 +34,13 @@ jobs:
components: "clippy, rustfmt"
cache-shared-key: cargo-${{ runner.os }}

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ steps.node-version.outputs.node-version }}
cache: "npm"
cache-dependency-path: crates/js/lib/package-lock.json

- name: Run cargo fmt
uses: actions-rust-lang/rustfmt@v1

Expand All @@ -55,7 +67,7 @@ jobs:
with:
node-version: ${{ steps.node-version.outputs.node-version }}
cache: "npm"
cache-dependency-path: crates/js/lib/package.json
cache-dependency-path: crates/js/lib/package-lock.json

- name: Install dependencies
run: npm ci
Expand Down Expand Up @@ -86,7 +98,7 @@ jobs:
with:
node-version: ${{ steps.node-version.outputs.node-version }}
cache: "npm"
cache-dependency-path: docs/package.json
cache-dependency-path: docs/package-lock.json

- name: Install dependencies
run: npm ci
Expand Down
14 changes: 13 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,25 @@ jobs:
run: echo "rust-version=$(grep '^rust ' .tool-versions | awk '{print $2}')" >> $GITHUB_OUTPUT
shell: bash

- name: Retrieve Node.js version
id: node-version
run: echo "node-version=$(grep '^nodejs ' .tool-versions | awk '{print $2}')" >> $GITHUB_OUTPUT
shell: bash

- name: Set up Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: ${{ steps.rust-version.outputs.rust-version }}
target: wasm32-wasip1
cache-shared-key: cargo-${{ runner.os }}

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ steps.node-version.outputs.node-version }}
cache: "npm"
cache-dependency-path: crates/js/lib/package-lock.json

- name: Get Viceroy cache key
id: viceroy-rev
run: echo "sha=$(git ls-remote https://github.com/fastly/Viceroy HEAD | cut -f1)" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -66,7 +78,7 @@ jobs:
with:
node-version: ${{ steps.node-version.outputs.node-version }}
cache: "npm"
cache-dependency-path: crates/js/lib/package.json
cache-dependency-path: crates/js/lib/package-lock.json

- name: Install dependencies
run: npm ci
Expand Down
8 changes: 4 additions & 4 deletions crates/js/lib/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ESLint v9 flat config
// ESLint flat config
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import importPlugin from 'eslint-plugin-import';
import perfectionist from 'eslint-plugin-perfectionist';
import jsdoc from 'eslint-plugin-jsdoc';
import unicorn from 'eslint-plugin-unicorn';

Expand All @@ -25,15 +25,15 @@ export default [
},
},
plugins: {
import: importPlugin,
perfectionist,
jsdoc,
unicorn,
'@typescript-eslint': tseslint.plugin,
},
rules: {
'unicorn/prevent-abbreviations': 'off',
'unicorn/filename-case': 'off',
'import/order': ['error', { 'newlines-between': 'always' }],
'perfectionist/sort-imports': ['error', { newlinesBetween: 1 }],
},
},
];
Loading
Loading