Skip to content

Commit

Permalink
workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
turbocrime committed Jun 19, 2024
1 parent 4a6862e commit 6de1ca0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 126 deletions.
36 changes: 0 additions & 36 deletions .github/workflows/compile-wasm.yml

This file was deleted.

15 changes: 6 additions & 9 deletions .github/workflows/extension-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,32 +13,29 @@ on:
workflow_call:
workflow_dispatch:

jobs:
turbo-compile:
name: Compile
uses: ./.github/workflows/compile-wasm.yml
env:
DO_NOT_TRACK: 1

jobs:
publish:
environment: ext-publish
name: Upload extension dist
runs-on: buildjet-16vcpu-ubuntu-2204
needs: turbo-compile

steps:
- uses: actions/checkout@v4
- id: built
uses: buildjet/cache@v3
with:
path: .turbo
key: ${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.ref }}-${{ github.sha }}-built
restore-keys: ${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.ref }}-${{ github.sha }}-compiled
key: ${{ hashFiles('pnpm-lock.yaml') }}-${{ github.ref }}-${{ github.sha }}-publish
restore-keys: ${{ hashFiles('pnpm-lock.yaml') }}-${{ github.ref }}-${{ github.sha }}-test
- uses: pnpm/action-setup@v2
- uses: buildjet/setup-node@v4
with:
node-version: '21'
node-version: '22'
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- run: pnpm turbo telemetry disable
- run: pnpm turbo build --cache-dir=.turbo

# Outputs beta.zip and prod.zip
Expand Down
97 changes: 16 additions & 81 deletions .github/workflows/turbo-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
branches:
- main

env:
DO_NOT_TRACK: 1

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
Expand All @@ -15,131 +18,63 @@ concurrency:
# the first action is commented, most of those comments apply to all actions
# every 'turbo' call is cached and essentially no-op if the inputs match

# tried to make wasm compile conditional, but that turned out to be complex.
# cache should make it decently fast.

# pnpm cached by lock hash
# turbo cached by cargo lock, pnpm lock in that order
# mostly, compiled wasm will restore from turbo cache
# rust cache only used in rust jobs
# turbo cached pnpm lock

jobs:
turbo-compile:
name: Compile
uses: ./.github/workflows/compile-wasm.yml

turbo-lint:
name: Lint
runs-on: buildjet-8vcpu-ubuntu-2204
needs: turbo-compile
steps:
- uses: actions/checkout@v4
- id: lint
uses: buildjet/cache@v3
with:
path: .turbo
key: ${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.ref }}-${{ github.sha }}-lint
restore-keys: ${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.ref }}-${{ github.sha }}-compiled
key: ${{ hashFiles('pnpm-lock.yaml') }}-${{ github.ref }}-${{ github.sha }}-lint
restore-keys: ${{ hashFiles('pnpm-lock.yaml') }}
- uses: pnpm/action-setup@v2
- uses: buildjet/setup-node@v4
with:
node-version: '21'
cache: 'pnpm'
node-version: "22"
cache: "pnpm"
- run: pnpm install --frozen-lockfile
- run: pnpm turbo telemetry disable
- run: pnpm turbo lint --cache-dir=.turbo

turbo-build:
name: Build
runs-on: buildjet-8vcpu-ubuntu-2204
needs: turbo-compile
steps:
- uses: actions/checkout@v4
- id: built
uses: buildjet/cache@v3
with:
path: .turbo
key: ${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.ref }}-${{ github.sha }}-built
restore-keys: ${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.ref }}-${{ github.sha }}-compiled
key: ${{ hashFiles('pnpm-lock.yaml') }}-${{ github.ref }}-${{ github.sha }}-built
restore-keys: ${{ hashFiles('pnpm-lock.yaml') }}
- uses: pnpm/action-setup@v2
- uses: buildjet/setup-node@v4
with:
node-version: '21'
cache: 'pnpm'
node-version: "22"
cache: "pnpm"
- run: pnpm install --frozen-lockfile
- run: pnpm turbo telemetry disable
- run: pnpm turbo build --cache-dir=.turbo

turbo-test:
name: test
runs-on: buildjet-4vcpu-ubuntu-2204
needs: turbo-compile
steps:
- uses: actions/checkout@v4
- id: tested
uses: buildjet/cache@v3
with:
path: .turbo
key: ${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.ref }}-${{ github.sha }}-test
restore-keys: ${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.ref }}-${{ github.sha }}-compiled
key: ${{ hashFiles('pnpm-lock.yaml') }}-${{ github.ref }}-${{ github.sha }}-test
restore-keys: ${{ hashFiles('pnpm-lock.yaml') }}
- uses: pnpm/action-setup@v2
- uses: buildjet/setup-node@v4
with:
node-version: '21'
cache: 'pnpm'
node-version: "22"
cache: "pnpm"
- run: pnpm install --frozen-lockfile
- run: pnpm turbo telemetry disable
- run: pnpm playwright install --with-deps chromium
- run: pnpm turbo test --cache-dir=.turbo

turbo-lint-rust:
name: lint:rust
runs-on: buildjet-4vcpu-ubuntu-2204
needs: turbo-compile
steps:
- uses: actions/checkout@v4
- id: rust-linted
uses: buildjet/cache@v3
with:
path: .turbo
key: ${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.ref }}-${{ github.sha }}-lint:rust
restore-keys: ${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.ref }}-${{ github.sha }}-compiled
- uses: pnpm/action-setup@v2
- uses: buildjet/setup-node@v4
with:
node-version: '21'
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- run: pnpm turbo telemetry disable
- run: pnpm turbo lint:rust --cache-dir=.turbo

turbo-test-rust:
name: test:rust
runs-on: buildjet-16vcpu-ubuntu-2204
needs: turbo-compile
steps:
- uses: actions/checkout@v4
- id: tested
uses: buildjet/cache@v3
with:
path: .turbo
key: ${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.ref }}-${{ github.sha }}-test:rust
restore-keys: ${{ hashFiles('**/Cargo.lock') }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.ref }}-${{ github.sha }}-compiled
- uses: pnpm/action-setup@v2
- uses: buildjet/setup-node@v4
with:
node-version: '21'
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- uses: jetli/[email protected]
with:
version: 'latest'
- uses: browser-actions/setup-firefox@v1
- run: pnpm turbo telemetry disable
- run: pnpm turbo test:rust --cache-dir=.turbo

0 comments on commit 6de1ca0

Please sign in to comment.