Skip to content

Commit

Permalink
Merge pull request #128 from anp/publish-prep
Browse files Browse the repository at this point in the history
Publish prep
  • Loading branch information
anp authored Jun 13, 2020
1 parent 9fb8e54 commit 6745460
Show file tree
Hide file tree
Showing 22 changed files with 1,128 additions and 961 deletions.
28 changes: 15 additions & 13 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
[profile.coverage]
inherits = "dev"
codegen-units = 1
incremental = false
opt-level = 0
overflow-checks = false
panic = "abort"

[alias]
####################################################################################################
# core crates:
Expand All @@ -9,43 +17,37 @@ core-flow = """
watch --clear
-x fmt-project
-x clippy-core
-x check-core
-x test-core
-x docs-clean
-x docs-all
"""

bench-core = "bench --all-targets --package illicit --package moxie --package topo"
check-core = "check --all-targets --package illicit --package moxie --package topo"
clippy-core = "clippy --package illicit --package moxie --package topo --package topo-macro"
test-core = "test --all-targets --package illicit --package moxie --package topo --package topo-macro"

docs-all = "doc --workspace --no-deps --all-features"
docs-clean = "clean --doc"

build-times = "build --workspace --all-targets --all-features -Z timings"
fmt-project = "ofl fmt"

####################################################################################################
# dom crates and examples

dom-flow = """
watch --clear
-x test-dom-lib
-x test-dom
-x test-augdom
-x test-dom-lib-browser
-x test-dom-drivertest
-x test-ssr-example
-x build-dom-hacking
-x test-dom-hacking
-x build-dom-todo
-x test-dom-todo
-x clippy-dom
"""

check-dom-lib = "check --package moxie-dom"
check-dom-hacking = "check --package dom-hacking"
check-dom-todo = "check --package todomvc-moxie"

wa-pack = "run --manifest-path dom/local-wasm-pack/Cargo.toml --"
wa-pack-build = "wa-pack build --target web --out-name index"
wa-test = "wa-pack test --firefox --headless"
Expand All @@ -54,13 +56,15 @@ build-dom-lib = "wa-pack-build dom"
build-dom-hacking = "wa-pack-build dom/examples/hacking"
build-dom-todo = "wa-pack-build dom/examples/todo"

# browser tests
test-augdom = "wa-test dom/augdom -- --all-features"
test-dom-lib = "test --package moxie-dom --all-targets"
test-dom-lib-browser = "wa-test dom"
test-dom-drivertest = "wa-test dom/examples/drivertest"
test-dom-hacking = "wa-test dom/examples/hacking"
test-dom-todo = "wa-test dom/examples/todo"
test-ssr-example = "test --package ssr-poc --all-targets"

# standalones
test-dom = "test --package moxie-dom --package ssr-poc --all-targets"

# dom utilities
clippy-dom = """clippy
Expand All @@ -80,18 +84,16 @@ build-website = "ofl website build target/website"
####################################################################################################
# ofl

ofl = "run --manifest-path ofl/Cargo.toml --"
ofl = "run --manifest-path ofl/Cargo.toml --release --"
server = "watch -w ofl/ -x ofl"

ofl-flow = """
watch --clear -w ofl
-x clippy-ofl
-x check-ofl
-x test-ofl
-x docs-ofl
"""

check-ofl = "check --manifest-path ofl/Cargo.toml --workspace"
clippy-ofl = "clippy --manifest-path ofl/Cargo.toml --workspace"
test-ofl = "test --manifest-path ofl/Cargo.toml --workspace"
docs-ofl = "doc --manifest-path ofl/Cargo.toml --workspace --no-deps"
8 changes: 4 additions & 4 deletions .dependabot/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
version: 1
update_configs:
- package_manager: "rust:cargo"
update_schedule: "live"
version: 1
update_configs:
- package_manager: "rust:cargo"
update_schedule: "live"
directory: "/"
171 changes: 96 additions & 75 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,75 +1,96 @@
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
main:
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@master

# WALL'O'CACHE!
- name: cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-registry-
- name: cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-index-
- run: rustup update

# tests
- run: cargo test-core
- run: cargo test-augdom
- run: cargo test-dom-lib
- run: cargo test-dom-lib-browser
- run: cargo test-dom-hacking
- run: cargo test-dom-todo
- run: cargo test-ssr-example
- run: cargo test-dom-drivertest

# examples, docs, website
- run: cargo build-dom-hacking
- run: cargo build-dom-todo
- run: cargo docs-all
- run: cargo docs-ofl
- run: cargo build-website

- name: promote website to prod, ensure crates published
if: github.ref == 'refs/heads/master' && runner.os == 'Linux'
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
run: |
npx netlify-cli deploy --prod
cargo login ${{ secrets.CARGO_API_TOKEN }}
cargo ofl published
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- run: rustup update
- run: rustup component add clippy
- run: cargo clippy-core
- run: cargo clippy-dom
- run: cargo clippy-ofl

fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- run: cargo fmt-project --check
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
main:
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@master
- uses: actions/cache@v2
with:
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
path: |
~/.cargo/registry
~/.cargo/git
ofl/target
- run: rustup update

# build all crates, collect timings
- run: cargo build-times
working-directory: ofl
- run: cargo build-times
- name: archive build timings
uses: actions/upload-artifact@v2
with:
name: build-times
path: "**/cargo-timing.html"

# tests with coverage
- run: cargo ofl coverage collect test-core
- run: cargo ofl coverage collect test-dom
- run: cargo ofl coverage report
- name: archive coverage
uses: actions/upload-artifact@v2
with:
name: coverage
path: target/coverage/html
- uses: codecov/codecov-action@v1
with:
file: ./target/coverage/lcov.info
fail_ci_if_error: true

# browser tests -- no coverage
- run: cargo test-augdom
- run: cargo test-dom-lib-browser
- run: cargo test-dom-hacking
- run: cargo test-dom-todo
- run: cargo test-dom-drivertest

# examples, docs, website
- run: cargo docs-all
- run: cargo docs-ofl
- run: cargo build-website

- name: assert the git repo hasn't changed
if: runner.os == 'Linux'
run: output=$(git status --porcelain) && [ -z "$output" ]
- name: archive website
if: runner.os == 'Linux'
uses: actions/upload-artifact@v2
with:
name: website
path: target/website
- name: promote website to prod, ensure crates published
if: github.ref == 'refs/heads/master' && runner.os == 'Linux'
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
run: |
npx netlify-cli deploy --prod
cargo login ${{ secrets.CARGO_API_TOKEN }}
cargo ofl published
clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- run: rustup update
- run: rustup component add clippy
- run: cargo clippy-core
- run: cargo clippy-dom
- run: cargo clippy-ofl

fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- run: cargo fmt-project --check
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ target/
**/*.rs.bk
/Cargo.lock
*.log
.vscode/
node_modules/
.idea/
pkg/
pkg/
cargo-timing*.html
Empty file removed .gitmodules
Empty file.
12 changes: 9 additions & 3 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"label": "core crates",
"type": "shell",
"presentation": {
"group": "main",
"panel": "dedicated"
},
"runOptions": {
Expand All @@ -25,6 +26,7 @@
"label": "dom crates",
"type": "shell",
"presentation": {
"group": "main",
"panel": "dedicated"
},
"runOptions": {
Expand All @@ -43,6 +45,7 @@
"label": "project website",
"type": "shell",
"presentation": {
"group": "tools",
"panel": "dedicated"
},
"runOptions": {
Expand All @@ -61,6 +64,7 @@
"label": "project server",
"type": "shell",
"presentation": {
"group": "tools",
"panel": "dedicated"
},
"runOptions": {
Expand All @@ -70,13 +74,15 @@
"command": "cargo",
"args": [
"server"
]
],
"problemMatcher": []
},
{
"label": "ofl crates",
"type": "shell",
"presentation": {
"panel": "dedicated"
"group": "tools",
"panel": "dedicated",
},
"runOptions": {
"runOn": "folderOpen"
Expand All @@ -89,6 +95,6 @@
"problemMatcher": [
"$rustc-watch"
]
},
}
]
}
Loading

0 comments on commit 6745460

Please sign in to comment.