Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into lit-interactive-examples
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoMcA committed Jan 14, 2025
2 parents e63605e + 0c190a0 commit f82475a
Showing 1 changed file with 48 additions and 3 deletions.
51 changes: 48 additions & 3 deletions .github/workflows/test-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ env:
on:
workflow_dispatch:
inputs:
rari-ref:
description: "rari ref to build (leave blank for npm release)"
type: string
default: ""

content-ref:
description: "content ref to build"
type: string
default: "main"

notes:
description: "Notes"
required: false
Expand Down Expand Up @@ -37,6 +47,13 @@ jobs:
if: github.repository == 'mdn/yari'

steps:
- name: Print information about build
run: |
echo "rari-ref: ${{ github.event.inputs.rari-ref }}"
echo "content-ref: ${{ github.event.inputs.content-ref }}"
echo "notes: ${{ github.event.inputs.notes || env.DEFAULT_NOTES }}"
echo "invalidate: ${{ github.event.inputs.invalidate }}"
- uses: actions/checkout@v4

- uses: actions/checkout@v4
Expand All @@ -49,6 +66,7 @@ jobs:
# but for now it's good enough. We'll need all the history
# so we can figure out each document's last-modified date.
fetch-depth: 0
ref: ${{ github.event.inputs.content-ref }}

- uses: actions/checkout@v4
if: ${{ ! vars.SKIP_BUILD }}
Expand Down Expand Up @@ -109,7 +127,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: yarn
cache: ${{ github.event.inputs.rari-ref == '' && 'yarn' || '' }}

- name: Install all yarn packages
if: ${{ ! vars.SKIP_BUILD }}
Expand All @@ -119,9 +137,36 @@ jobs:
# See https://github.com/microsoft/vscode-ripgrep#github-api-limit-note
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Print information about build
- uses: actions/checkout@v4
if: ${{ !( vars.SKIP_BUILD || github.event.inputs.rari-ref == '' ) }}
with:
repository: mdn/rari
path: mdn/rari
ref: ${{ github.event.inputs.rari-ref }}

- name: Cache Cargo registry
if: ${{ !( vars.SKIP_BUILD || github.event.inputs.rari-ref == '' ) }}
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-cargo-

- uses: dtolnay/rust-toolchain@stable
if: ${{ !( vars.SKIP_BUILD || github.event.inputs.rari-ref == '' ) }}

- name: sccache-cache
if: ${{ !( vars.SKIP_BUILD || github.event.inputs.rari-ref == '' ) }}
uses: mozilla-actions/sccache-action@v0.0.7

- name: Build rari
if: ${{ !( vars.SKIP_BUILD || github.event.inputs.rari-ref == '' ) }}
run: |
echo "notes: ${{ github.event.inputs.notes || env.DEFAULT_NOTES }}"
cd mdn/rari
cargo build --release
cp target/release/rari ../../node_modules/@mdn/rari/bin/
- name: Print information about CPU
run: cat /proc/cpuinfo
Expand Down

0 comments on commit f82475a

Please sign in to comment.