Browse Source

Improved CI workflows (#330)

pull/343/head
Iban Eguia 5 years ago committed by GitHub
parent
commit
91bece6f62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 33
      .github/workflows/benchmark.yml
  2. 82
      .github/workflows/master.yml
  3. 6
      .github/workflows/pull_request.yml
  4. 90
      .github/workflows/rust.yml

33
.github/workflows/benchmark.yml

@ -1,33 +0,0 @@
name: Boa Benchmarks on master
on:
push:
branches:
- master
jobs:
benchmark:
name: Run Criterion benchmark
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rustup toolchain update stable && rustup default stable
- name: Run benchmark
run: cargo bench -p Boa | tee output.txt
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Store benchmark result
uses: jasonwilliams/github-action-benchmark@v1
with:
name: Boa Benchmarks
tool: "criterion"
output-file-path: output.txt
auto-push: true
github-token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}

82
.github/workflows/master.yml

@ -0,0 +1,82 @@
name: Master workflows
on:
push:
branches:
- master
jobs:
benchmark:
name: Run Criterion benchmark
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Run benchmark
run: cargo bench -p Boa | tee output.txt
- name: Store benchmark result
uses: jasonwilliams/github-action-benchmark@v1
with:
name: Boa Benchmarks
tool: "criterion"
output-file-path: output.txt
auto-push: true
github-token: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
doc-upload:
name: Upload documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Generate documentation
uses: actions-rs/cargo@v1
with:
command: doc
args: -v --document-private-items
- run: echo "<meta http-equiv=refresh content=0;url=boa/index.html>" > target/doc/index.html
- name: Upload documentation
uses: appleboy/gh-pages-action@0.0.2
with:
username: ${{ secrets.USERNAME }}
password: ${{ secrets.PERSONAL_GITHUB_TOKEN }}
remote_url: https://github.com/${{ env.GITHUB_REPOSITORY }}.git
target_directory: target/doc
target_branch: gh-pages-test

6
.github/workflows/pull_request.yml

@ -10,11 +10,17 @@ jobs:
with:
toolchain: stable
override: true
profile: minimal
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v1
with:

90
.github/workflows/rust.yml

@ -18,9 +18,26 @@ jobs:
with:
toolchain: stable
override: true
profile: minimal
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rs/cargo@v1
with:
command: check
args: -v
check_on_windows:
name: Check on Windows
@ -31,9 +48,11 @@ jobs:
with:
toolchain: stable
override: true
profile: minimal
- uses: actions-rs/cargo@v1
with:
command: check
args: -v
test_on_linux:
name: Test Suite on Linux
@ -44,9 +63,26 @@ jobs:
with:
toolchain: stable
override: true
profile: minimal
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rs/cargo@v1
with:
command: test
args: -v
test_on_windows:
name: Test Suite on Windows
@ -57,9 +93,11 @@ jobs:
with:
toolchain: stable
override: true
profile: minimal
- uses: actions-rs/cargo@v1
with:
command: test
args: -v
fmt:
name: Rustfmt
@ -70,7 +108,8 @@ jobs:
with:
toolchain: stable
override: true
- run: rustup component add rustfmt
profile: minimal
components: rustfmt
- uses: actions-rs/cargo@v1
with:
command: fmt
@ -85,8 +124,55 @@ jobs:
with:
toolchain: stable
override: true
- run: rustup component add clippy
profile: minimal
components: clippy
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- --verbose
doc:
name: Documentation check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
profile: minimal
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo build
uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- name: Generate documentation
uses: actions-rs/cargo@v1
with:
command: doc
args: -v --document-private-items

Loading…
Cancel
Save