mirror of https://github.com/boa-dev/boa.git
Browse Source
Currently we run 7 different jobs: - tests linux - tests macos - tests windows - rustfmt - clippy - examples - documentation With this change I reduced them to 4 and hopefully sped them up. The total execution time is limited by the tests, especially linux that calculates coverage. Having separate jobs for clippy and rustfmt (which take a very small amount of time) is a waste of energy. With this PR: Introduced a new cargo profile, `ci`, that should create smaller sized binaries and reduce the our cache usage. I changed the test runner for macos and windows to [nextest](https://nexte.st/), which should be faster and is specifically designed for CI. I merged all smaller tasks in a single job, misc, the steps clearly identify what is being tested so it shouldn't affect clarity. Switched to using the [rust-cache](https://github.com/Swatinem/rust-cache) GH action, this simplifies our work by no longer having to worry about which directories to cache, rust-cache handles all that for us. ~~The bors task should also be modified, I'll get to it as soon as I have time. I believe it should be possible for us to have a single workflow described and have it both be the normal CI and the bors test.~~pull/2380/head
João Borges
2 years ago
5 changed files with 59 additions and 298 deletions
@ -0,0 +1,3 @@ |
|||||||
|
[profile.ci] |
||||||
|
# Don't fail fast in CI to run the full test suite. |
||||||
|
fail-fast = false |
@ -1,162 +0,0 @@ |
|||||||
name: bors |
|
||||||
|
|
||||||
on: |
|
||||||
push: |
|
||||||
branches: |
|
||||||
- staging |
|
||||||
- trying |
|
||||||
|
|
||||||
jobs: |
|
||||||
test_on_linux: |
|
||||||
name: Tests on Linux |
|
||||||
runs-on: ubuntu-latest |
|
||||||
steps: |
|
||||||
- uses: actions/checkout@v3 |
|
||||||
- uses: actions-rs/toolchain@v1.0.7 |
|
||||||
with: |
|
||||||
toolchain: stable |
|
||||||
override: true |
|
||||||
profile: minimal |
|
||||||
- name: Cache cargo |
|
||||||
uses: actions/cache@v3 |
|
||||||
with: |
|
||||||
path: | |
|
||||||
target |
|
||||||
~/.cargo/git |
|
||||||
~/.cargo/registry |
|
||||||
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }} |
|
||||||
- uses: actions-rs/cargo@v1 |
|
||||||
with: |
|
||||||
command: test |
|
||||||
args: -v |
|
||||||
|
|
||||||
test_on_windows: |
|
||||||
name: Tests on Windows |
|
||||||
runs-on: windows-latest |
|
||||||
steps: |
|
||||||
- uses: actions/checkout@v3 |
|
||||||
- uses: actions-rs/toolchain@v1.0.7 |
|
||||||
with: |
|
||||||
toolchain: stable |
|
||||||
override: true |
|
||||||
profile: minimal |
|
||||||
- name: Cache cargo |
|
||||||
uses: actions/cache@v3 |
|
||||||
with: |
|
||||||
path: | |
|
||||||
target |
|
||||||
~/.cargo/git |
|
||||||
~/.cargo/registry |
|
||||||
key: ${{ runner.os }}-cargo-test-${{ hashFiles('**/Cargo.lock') }} |
|
||||||
- uses: actions-rs/cargo@v1 |
|
||||||
with: |
|
||||||
command: test |
|
||||||
args: -v |
|
||||||
|
|
||||||
test_on_macos: |
|
||||||
name: Tests on MacOS |
|
||||||
runs-on: macos-latest |
|
||||||
steps: |
|
||||||
- uses: actions/checkout@v3 |
|
||||||
- uses: actions-rs/toolchain@v1.0.7 |
|
||||||
with: |
|
||||||
toolchain: stable |
|
||||||
override: true |
|
||||||
profile: minimal |
|
||||||
- uses: actions-rs/cargo@v1 |
|
||||||
with: |
|
||||||
command: test |
|
||||||
args: -v |
|
||||||
|
|
||||||
fmt: |
|
||||||
name: Rustfmt |
|
||||||
runs-on: ubuntu-latest |
|
||||||
steps: |
|
||||||
- uses: actions/checkout@v3 |
|
||||||
- uses: actions-rs/toolchain@v1.0.7 |
|
||||||
with: |
|
||||||
toolchain: stable |
|
||||||
override: true |
|
||||||
profile: minimal |
|
||||||
components: rustfmt |
|
||||||
- uses: actions-rs/cargo@v1 |
|
||||||
with: |
|
||||||
command: fmt |
|
||||||
args: --all -- --check |
|
||||||
|
|
||||||
clippy: |
|
||||||
name: Clippy |
|
||||||
runs-on: ubuntu-latest |
|
||||||
steps: |
|
||||||
- uses: actions/checkout@v3 |
|
||||||
- uses: actions-rs/toolchain@v1.0.7 |
|
||||||
with: |
|
||||||
toolchain: stable |
|
||||||
override: true |
|
||||||
profile: minimal |
|
||||||
components: clippy |
|
||||||
- name: Cache cargo |
|
||||||
uses: actions/cache@v3 |
|
||||||
with: |
|
||||||
path: | |
|
||||||
target |
|
||||||
~/.cargo/git |
|
||||||
~/.cargo/registry |
|
||||||
key: ${{ runner.os }}-cargo-clippy-${{ hashFiles('**/Cargo.lock') }} |
|
||||||
- uses: actions-rs/cargo@v1 |
|
||||||
with: |
|
||||||
command: clippy |
|
||||||
args: -- --verbose |
|
||||||
|
|
||||||
examples: |
|
||||||
name: Examples |
|
||||||
runs-on: ubuntu-latest |
|
||||||
steps: |
|
||||||
- uses: actions/checkout@v3 |
|
||||||
- uses: actions-rs/toolchain@v1.0.7 |
|
||||||
with: |
|
||||||
toolchain: stable |
|
||||||
override: true |
|
||||||
profile: minimal |
|
||||||
- name: Cache cargo |
|
||||||
uses: actions/cache@v3 |
|
||||||
with: |
|
||||||
path: | |
|
||||||
target |
|
||||||
~/.cargo/git |
|
||||||
~/.cargo/registry |
|
||||||
key: ${{ runner.os }}-cargo-examples-${{ hashFiles('**/Cargo.lock') }} |
|
||||||
- run: cd boa_examples |
|
||||||
- name: Build examples |
|
||||||
uses: actions-rs/cargo@v1 |
|
||||||
with: |
|
||||||
command: build |
|
||||||
- name: Run example classes |
|
||||||
uses: actions-rs/cargo@v1 |
|
||||||
with: |
|
||||||
command: run |
|
||||||
args: --bin classes |
|
||||||
|
|
||||||
doc: |
|
||||||
name: Documentation |
|
||||||
runs-on: ubuntu-latest |
|
||||||
steps: |
|
||||||
- uses: actions/checkout@v3 |
|
||||||
- uses: actions-rs/toolchain@v1.0.7 |
|
||||||
with: |
|
||||||
toolchain: stable |
|
||||||
override: true |
|
||||||
profile: minimal |
|
||||||
- name: Cache cargo |
|
||||||
uses: actions/cache@v3 |
|
||||||
with: |
|
||||||
path: | |
|
||||||
target |
|
||||||
~/.cargo/git |
|
||||||
~/.cargo/registry |
|
||||||
key: ${{ runner.os }}-cargo-doc-${{ hashFiles('**/Cargo.lock') }} |
|
||||||
- name: Generate documentation |
|
||||||
uses: actions-rs/cargo@v1 |
|
||||||
with: |
|
||||||
command: doc |
|
||||||
args: -v --document-private-items --all-features |
|
Loading…
Reference in new issue