Refactor actions to reuse shared steps
This commit is contained in:
20
.github/actions/build-frontend/action.yml
vendored
Normal file
20
.github/actions/build-frontend/action.yml
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
name: Build the frontend assets
|
||||
description: Installs Node.js and builds the frontend assets from the frontend directory
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v4.2.0
|
||||
with:
|
||||
node-version: '22'
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
working-directory: ./frontend
|
||||
shell: sh
|
||||
|
||||
- name: Build the frontend assets
|
||||
run: npm run build
|
||||
working-directory: ./frontend
|
||||
shell: sh
|
||||
15
.github/actions/build-policies/action.yml
vendored
Normal file
15
.github/actions/build-policies/action.yml
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
name: Build the Open Policy Agent policies
|
||||
description: Installs OPA and builds the policies
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- name: Install Open Policy Agent
|
||||
uses: open-policy-agent/setup-opa@v2.2.0
|
||||
with:
|
||||
version: 0.70.0
|
||||
|
||||
- name: Build the policies
|
||||
run: make
|
||||
working-directory: ./policies
|
||||
shell: sh
|
||||
23
.github/workflows/build.yaml
vendored
23
.github/workflows/build.yaml
vendored
@@ -59,27 +59,8 @@ jobs:
|
||||
- name: Checkout the code
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Setup OPA
|
||||
uses: open-policy-agent/setup-opa@v2.2.0
|
||||
with:
|
||||
version: 0.64.1
|
||||
|
||||
- name: Install frontend Node
|
||||
uses: actions/setup-node@v4.2.0
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: Install frontend Node dependencies
|
||||
working-directory: ./frontend
|
||||
run: npm ci
|
||||
|
||||
- name: Build frontend
|
||||
working-directory: ./frontend
|
||||
run: npm run build
|
||||
|
||||
- name: Build policies
|
||||
working-directory: ./policies
|
||||
run: make
|
||||
- uses: ./.github/actions/build-frontend
|
||||
- uses: ./.github/actions/build-policies
|
||||
|
||||
- name: Prepare assets artifact
|
||||
run: |
|
||||
|
||||
60
.github/workflows/ci.yaml
vendored
60
.github/workflows/ci.yaml
vendored
@@ -63,7 +63,7 @@ jobs:
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v4.2.0
|
||||
with:
|
||||
node-version: 20
|
||||
node-version: 22
|
||||
|
||||
- name: Install Node dependencies
|
||||
working-directory: ./frontend
|
||||
@@ -88,7 +88,7 @@ jobs:
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v4.2.0
|
||||
with:
|
||||
node-version: 20
|
||||
node-version: 22
|
||||
|
||||
- name: Install Node dependencies
|
||||
working-directory: ./frontend
|
||||
@@ -135,11 +135,10 @@ jobs:
|
||||
- name: Checkout the code
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Install toolchain
|
||||
run: |
|
||||
rustup toolchain install nightly
|
||||
rustup default nightly
|
||||
rustup component add rustfmt
|
||||
- name: Install Rust toolchain
|
||||
uses: dtolnay/rust-toolchain@nightly
|
||||
with:
|
||||
components: rustfmt
|
||||
|
||||
- name: Check style
|
||||
run: cargo fmt --all -- --check
|
||||
@@ -183,14 +182,7 @@ jobs:
|
||||
- name: Setup sccache
|
||||
uses: mozilla-actions/sccache-action@v0.0.7
|
||||
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v4.2.0
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: Install Node dependencies
|
||||
working-directory: ./frontend
|
||||
run: npm ci
|
||||
- uses: ./.github/actions/build-frontend
|
||||
|
||||
- name: Update the schemas
|
||||
run: sh ./misc/update.sh
|
||||
@@ -224,11 +216,10 @@ jobs:
|
||||
- name: Checkout the code
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Install toolchain
|
||||
run: |
|
||||
rustup toolchain install 1.84.0
|
||||
rustup default 1.84.0
|
||||
rustup component add clippy
|
||||
- name: Install Rust toolchain
|
||||
uses: dtolnay/rust-toolchain@1.84.0
|
||||
with:
|
||||
components: clippy
|
||||
|
||||
- name: Setup OPA
|
||||
uses: open-policy-agent/setup-opa@v2.2.0
|
||||
@@ -258,10 +249,8 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Install toolchain
|
||||
run: |
|
||||
rustup toolchain install stable
|
||||
rustup default stable
|
||||
- name: Install Rust toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Install nextest
|
||||
uses: taiki-e/install-action@v2
|
||||
@@ -320,27 +309,8 @@ jobs:
|
||||
with:
|
||||
tool: cargo-nextest
|
||||
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v4.2.0
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: Install Node dependencies
|
||||
working-directory: ./frontend
|
||||
run: npm ci
|
||||
|
||||
- name: Build the frontend
|
||||
working-directory: ./frontend
|
||||
run: npm run build
|
||||
|
||||
- name: Setup OPA
|
||||
uses: open-policy-agent/setup-opa@v2.2.0
|
||||
with:
|
||||
version: 0.64.1
|
||||
|
||||
- name: Compile OPA policies
|
||||
working-directory: ./policies
|
||||
run: make
|
||||
- uses: ./.github/actions/build-frontend
|
||||
- uses: ./.github/actions/build-policies
|
||||
|
||||
- name: Download archive
|
||||
uses: actions/download-artifact@v4
|
||||
|
||||
45
.github/workflows/coverage.yaml
vendored
45
.github/workflows/coverage.yaml
vendored
@@ -54,18 +54,7 @@ jobs:
|
||||
- name: Checkout the code
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v4.2.0
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: Install Node dependencies
|
||||
working-directory: ./frontend
|
||||
run: npm ci
|
||||
|
||||
- name: Build the frontend
|
||||
working-directory: ./frontend
|
||||
run: npm run build
|
||||
- uses: ./.github/actions/build-frontend
|
||||
env:
|
||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
@@ -110,33 +99,10 @@ jobs:
|
||||
- name: Checkout the code
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Install toolchain
|
||||
run: |
|
||||
rustup toolchain install stable
|
||||
rustup default stable
|
||||
rustup component add llvm-tools-preview
|
||||
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v4.2.0
|
||||
- name: Install Rust toolchain
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
with:
|
||||
node-version: 20
|
||||
|
||||
- name: Install Node dependencies
|
||||
working-directory: ./frontend
|
||||
run: npm ci
|
||||
|
||||
- name: Build the frontend
|
||||
working-directory: ./frontend
|
||||
run: npm run build
|
||||
|
||||
- name: Setup OPA
|
||||
uses: open-policy-agent/setup-opa@v2.2.0
|
||||
with:
|
||||
version: 0.64.1
|
||||
|
||||
- name: Compile OPA policies
|
||||
working-directory: ./policies
|
||||
run: make
|
||||
components: llvm-tools-preview
|
||||
|
||||
- name: Setup sccache
|
||||
uses: mozilla-actions/sccache-action@v0.0.7
|
||||
@@ -146,6 +112,9 @@ jobs:
|
||||
with:
|
||||
tool: grcov
|
||||
|
||||
- uses: ./.github/actions/build-frontend
|
||||
- uses: ./.github/actions/build-policies
|
||||
|
||||
- name: Run test suite with profiling enabled
|
||||
run: |
|
||||
cargo test --no-fail-fast --workspace
|
||||
|
||||
6
.github/workflows/docs.yaml
vendored
6
.github/workflows/docs.yaml
vendored
@@ -23,9 +23,7 @@ jobs:
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Install Rust toolchain
|
||||
run: |
|
||||
rustup toolchain install stable
|
||||
rustup default stable
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Setup sccache
|
||||
uses: mozilla-actions/sccache-action@v0.0.7
|
||||
@@ -38,7 +36,7 @@ jobs:
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v4.2.0
|
||||
with:
|
||||
node-version: 20
|
||||
node-version: 22
|
||||
|
||||
- name: Build the documentation
|
||||
run: sh misc/build-docs.sh
|
||||
|
||||
6
.github/workflows/release-branch.yaml
vendored
6
.github/workflows/release-branch.yaml
vendored
@@ -23,9 +23,7 @@ jobs:
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Install Rust toolchain
|
||||
run: |
|
||||
rustup toolchain install stable
|
||||
rustup default stable
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Compute the new minor RC
|
||||
id: next
|
||||
@@ -52,7 +50,7 @@ jobs:
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v4.2.0
|
||||
with:
|
||||
node-version: 20
|
||||
node-version: 22
|
||||
|
||||
- name: Install Localazy CLI
|
||||
run: npm install -g @localazy/cli
|
||||
|
||||
4
.github/workflows/release-bump.yaml
vendored
4
.github/workflows/release-bump.yaml
vendored
@@ -31,9 +31,7 @@ jobs:
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Install Rust toolchain
|
||||
run: |
|
||||
rustup toolchain install stable
|
||||
rustup default stable
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Extract the current version
|
||||
id: current
|
||||
|
||||
4
.github/workflows/tag.yaml
vendored
4
.github/workflows/tag.yaml
vendored
@@ -28,9 +28,7 @@ jobs:
|
||||
uses: actions/checkout@v4.2.2
|
||||
|
||||
- name: Install Rust toolchain
|
||||
run: |
|
||||
rustup toolchain install stable
|
||||
rustup default stable
|
||||
uses: dtolnay/rust-toolchain@stable
|
||||
|
||||
- name: Set the crates version
|
||||
env:
|
||||
|
||||
2
.github/workflows/translations-download.yaml
vendored
2
.github/workflows/translations-download.yaml
vendored
@@ -19,7 +19,7 @@ jobs:
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v4.2.0
|
||||
with:
|
||||
node-version: 20
|
||||
node-version: 22
|
||||
|
||||
- name: Install Localazy CLI
|
||||
run: npm install -g @localazy/cli
|
||||
|
||||
2
.github/workflows/translations-upload.yaml
vendored
2
.github/workflows/translations-upload.yaml
vendored
@@ -18,7 +18,7 @@ jobs:
|
||||
- name: Install Node
|
||||
uses: actions/setup-node@v4.2.0
|
||||
with:
|
||||
node-version: 20
|
||||
node-version: 22
|
||||
|
||||
- name: Install Localazy CLI
|
||||
run: npm install -g @localazy/cli
|
||||
|
||||
Reference in New Issue
Block a user