-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
97b635b
commit df6ada8
Showing
5 changed files
with
104 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,9 +21,11 @@ jobs: | |
|
||
- name: Install dependencies | ||
run: pnpm install | ||
working-directory: apps/webapp | ||
|
||
- name: Build static site | ||
run: pnpm build | ||
working-directory: apps/webapp | ||
|
||
- name: Deploy dapp static site to firebase | ||
uses: w9jds/[email protected] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,29 +9,68 @@ on: [pull_request, workflow_dispatch] | |
# pnpm deps are cached by lockfile hash | ||
|
||
jobs: | ||
wasm-diff: | ||
check-diff: | ||
outputs: | ||
wasm-diff: ${{ steps.diff.outputs.exit_code }} | ||
wasm-diff-main: ${{ steps.run-wasm-diff-main.outcome }} | ||
wasm-diff-prev: ${{ steps.run-wasm-diff-prev.outcome }} | ||
name: Diff | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'pull_request' # only run on PRs | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- id: diff # store diff exit code in output | ||
run: git diff --exit-code main packages/wasm/crate | ||
- run: git fetch origin main:main | ||
- run: git fetch origin ${{ github.head_ref }}:${{ github.head_ref }} | ||
- id: run-wasm-diff-main | ||
run: git diff main --exit-code packages/wasm/crate | ||
continue-on-error: true | ||
- id: run-wasm-diff-prev | ||
run: git diff ${{ github.head_ref }} --exit-code packages/wasm/crate | ||
continue-on-error: true | ||
|
||
turbo-compile: | ||
name: Compile | ||
needs: wasm-diff | ||
# only run if wasm crate changed, or dispatch | ||
if: github.workflow_dispatch || needs.wasm-diff.outputs.wasm-diff == '1' | ||
needs: check-diff | ||
# only run if wasm crate changed, rerun was requested, or manually dispatched | ||
if: github.event_name == 'workflow_dispatch' || needs.check-diff.outputs.wasm-diff-main == 'failure'|| needs.check-diff.outputs.wasm-diff-prev == 'failure' || github.run_attempt > 1 | ||
uses: ./.github/workflows/compile-wasm.yml | ||
|
||
test-rust: | ||
name: test:rust | ||
needs: turbo-compile | ||
uses: ./.github/workflows/test-wasm.yml | ||
turbo-test-rust: | ||
name: 'test:rust' | ||
runs-on: buildjet-16vcpu-ubuntu-2204 # buildjet for rust, github standard for everything else | ||
needs: [turbo-compile, turbo-build] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- id: compiled # this also compiles, so we can use or write the same cache | ||
uses: actions/cache@v3 # turbo cache, shared between buildjet and github | ||
with: | ||
path: .turbo | ||
key: ${{ runner.os }}-turbo-${{ hashFiles('packages/wasm/cargo/src/**') }}-${{ github.ref }}-${{ github.sha }}-test:rust | ||
restore-keys: | | ||
${{ runner.os }}-turbo-${{ hashFiles('packages/wasm/cargo/src/**') }}-${{ github.ref }}-${{ github.sha }}-built | ||
${{ runner.os }}-turbo-${{ hashFiles('packages/wasm/cargo/src/**') }}-${{ github.ref }}-${{ github.sha }} | ||
${{ runner.os }}-turbo-${{ hashFiles('packages/wasm/cargo/src/**') }}-${{ github.ref }} | ||
${{ runner.os }}-turbo-${{ hashFiles('packages/wasm/cargo/src/**') }} | ||
- uses: pnpm/action-setup@v2 | ||
- uses: buildjet/setup-node@v4 # node cache, distinct between buildjet and github | ||
with: | ||
node-version: '21' | ||
cache: 'pnpm' | ||
- run: pnpm install --frozen-lockfile # commit your lockfile | ||
- run: pnpm turbo telemetry disable | ||
|
||
- uses: dtolnay/rust-toolchain@stable # rust only on buildjet | ||
with: | ||
targets: wasm32-unknown-unknown | ||
- uses: astriaorg/[email protected] # buildjet rust cache | ||
- uses: jetli/[email protected] # preinstall wasm-pack | ||
with: | ||
version: 'latest' | ||
- uses: browser-actions/setup-firefox@v1 # wasm tests in ffx | ||
|
||
- run: pnpm turbo test:rust --cache-dir=.turbo # test wasm | ||
|
||
- run: cargo tree --invert mio --edges features # debug tree | ||
if: failure() | ||
working-directory: packages/wasm/crate | ||
|
||
turbo-lint: | ||
name: Lint | ||
|
@@ -40,13 +79,16 @@ jobs: | |
if: always() # always run even if we skip compile | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/cache@v3 # turbo cache, shared between buildjet and github | ||
id: turbo-cache | ||
- id: lint | ||
uses: actions/cache@v3 # turbo cache, shared between buildjet and github | ||
with: | ||
path: .turbo | ||
key: ${{ runner.os }}-turbo-${{ github.sha }} | ||
key: ${{ runner.os }}-turbo-${{ hashFiles('packages/wasm/cargo/src/**') }}-${{ github.ref }}-${{ github.sha }}-lint | ||
restore-keys: | | ||
${{ runner.os }}-turbo- | ||
${{ runner.os }}-turbo-${{ hashFiles('packages/wasm/cargo/src/**') }}-${{ github.ref }}-${{ github.sha }}-compiled | ||
${{ runner.os }}-turbo-${{ hashFiles('packages/wasm/cargo/src/**') }}-${{ github.ref }}-${{ github.sha }} | ||
${{ runner.os }}-turbo-${{ hashFiles('packages/wasm/cargo/src/**') }}-${{ github.ref }} | ||
${{ runner.os }}-turbo-${{ hashFiles('packages/wasm/cargo/src/**') }} | ||
- uses: pnpm/action-setup@v2 | ||
- uses: actions/setup-node@v4 # node cache, distinct between buildjet and github | ||
with: | ||
|
@@ -64,13 +106,16 @@ jobs: | |
if: always() # always run even if we skip compile | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/cache@v3 | ||
id: turbo-cache | ||
- id: built | ||
uses: actions/cache@v3 | ||
with: | ||
path: .turbo | ||
key: ${{ runner.os }}-turbo-${{ github.sha }} | ||
key: ${{ runner.os }}-turbo-${{ hashFiles('packages/wasm/cargo/src/**') }}-${{ github.ref }}-${{ github.sha }}-built | ||
restore-keys: | | ||
${{ runner.os }}-turbo- | ||
${{ runner.os }}-turbo-${{ hashFiles('packages/wasm/cargo/src/**') }}-${{ github.ref }}-${{ github.sha }}-compiled | ||
${{ runner.os }}-turbo-${{ hashFiles('packages/wasm/cargo/src/**') }}-${{ github.ref }}-${{ github.sha }} | ||
${{ runner.os }}-turbo-${{ hashFiles('packages/wasm/cargo/src/**') }}-${{ github.ref }} | ||
${{ runner.os }}-turbo-${{ hashFiles('packages/wasm/cargo/src/**') }} | ||
- uses: pnpm/action-setup@v2 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
|
@@ -83,25 +128,29 @@ jobs: | |
turbo-test: | ||
strategy: | ||
matrix: | ||
task: ['test', 'test:browser'] # all typescript tests | ||
name: ${{ matrix.task }} | ||
test: ['test', 'test:browser'] # all typescript tests | ||
name: ${{ matrix.test }} | ||
runs-on: ubuntu-latest | ||
needs: turbo-build | ||
if: always() # always run even if we skip compile | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/cache@v3 | ||
id: turbo-cache | ||
- id: tested | ||
uses: actions/cache@v3 | ||
with: | ||
path: .turbo | ||
key: ${{ runner.os }}-turbo-${{ github.sha }} | ||
key: ${{ runner.os }}-turbo-${{ hashFiles('packages/wasm/cargo/src/**') }}-${{ github.ref }}-${{ github.sha }}-${{ matrix.test }} | ||
restore-keys: | | ||
${{ runner.os }}-turbo- | ||
${{ runner.os }}-turbo-${{ hashFiles('packages/wasm/cargo/src/**') }}-${{ github.ref }}-${{ github.sha }}-built | ||
${{ runner.os }}-turbo-${{ hashFiles('packages/wasm/cargo/src/**') }}-${{ github.ref }}-${{ github.sha }}-compiled | ||
${{ runner.os }}-turbo-${{ hashFiles('packages/wasm/cargo/src/**') }}-${{ github.ref }}-${{ github.sha }} | ||
${{ runner.os }}-turbo-${{ hashFiles('packages/wasm/cargo/src/**') }}-${{ github.ref }} | ||
${{ runner.os }}-turbo-${{ hashFiles('packages/wasm/cargo/src/**') }} | ||
- uses: pnpm/action-setup@v2 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: '21' | ||
cache: 'pnpm' | ||
- run: pnpm install --frozen-lockfile | ||
- run: pnpm turbo telemetry disable | ||
- run: pnpm turbo ${{ matrix.task }} --cache-dir=.turbo | ||
- run: pnpm turbo ${{ matrix.test }} --cache-dir=.turbo |