Skip to content

Commit

Permalink
Enrich tests (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
placintaalexandru authored Nov 14, 2023
1 parent 3a3c546 commit b754186
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 31 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Check
name: Lint check
on:
push:
branches:
Expand Down
30 changes: 24 additions & 6 deletions .github/workflows/test_components_input.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,19 @@ concurrency:
cancel-in-progress: true
jobs:
install_on_runner:
name: Components (runner)
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
# Test with multiple spacing
components:
- clippy, miri, llvm-tools-preview
- clippy,miri,llvm-tools-preview
- clippy,miri, llvm-tools-preview
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -35,15 +41,21 @@ jobs:
toolchain: nightly
profile: minimal
override: true
# 2 components not included within the minimal profile
components: clippy, miri
components: "${{ matrix.components }}"

- name: Test clippy exists
run: cargo clippy -V
run: |
test $(rustup component list | grep clippy | wc -l) -eq 1
- name: Test miri exists
run: cargo miri -V
run: |
test $(rustup component list | grep clippy | wc -l) -eq 1
- name: Test llvm exists
run: |
test $(rustup component list | grep llvm | wc -l) -eq 1
install_in_docker:
name: Components (docker)
runs-on: ubuntu-latest
# Docker image, not the GitHub Actions VM
container: ubuntu:latest
Expand All @@ -65,7 +77,13 @@ jobs:
components: clippy, miri

- name: Test clippy exists
run: cargo clippy -V
run: |
test $(rustup component list | grep clippy | wc -l) -eq 1
- name: Test miri exists
run: cargo miri -V
run: |
test $(rustup component list | grep clippy | wc -l) -eq 1
- name: Test llvm exists
run: |
test $(rustup component list | grep llvm | wc -l) -eq 1
4 changes: 3 additions & 1 deletion .github/workflows/test_install_stable_nightly_beta.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI Test - install stable, nightly, and beta
name: CI Test - install toolchain stable, nightly, and beta
on:
push:
branches:
Expand All @@ -18,6 +18,7 @@ concurrency:
cancel-in-progress: true
jobs:
install_on_runner:
name: Toolchain stable, nightly, and beta (runner)
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand Down Expand Up @@ -53,6 +54,7 @@ jobs:
echo "$CARGO" && test "$CARGO" != ""
echo "$RUSTUP" && test "$RUSTUP" != ""
install_in_docker:
name: Toolchain stable, nightly, and beta (docker)
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/test_override_input.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ concurrency:
cancel-in-progress: true
jobs:
install_on_runner:
name: Override (runner)
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -39,11 +40,11 @@ jobs:
profile: minimal
override: true

- name: Test toolchain version
- name: Test override
run: |
test "${{ steps.toolchain.outputs.rustc }}" = "${{ matrix.toolchain }}"
test $(rustup override list | grep "${{ matrix.toolchain }}" | wc -l) -eq 1
install_in_docker:
name: Override (docker)
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -67,6 +68,6 @@ jobs:
profile: minimal
override: true

- name: Test toolchain version
- name: Test override
run: |
test "${{ steps.toolchain.outputs.rustc }}" = "${{ matrix.toolchain }}"
test $(rustup override list | grep "${{ matrix.toolchain }}" | wc -l) -eq 1
31 changes: 18 additions & 13 deletions .github/workflows/test_targets_input.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,19 @@ concurrency:
cancel-in-progress: true
jobs:
install_on_runner:
name: Targets (runner)
runs-on: ${{ matrix.os }}
strategy:
matrix:
os:
- ubuntu-latest
- macOS-latest
- windows-latest
# These are 2 more exotic targets that are not found on the runners
target:
- wasm32-unknown-unknown, arm-linux-androideabi
# Test with multiple spacing
targets:
- wasm32-unknown-unknown, arm-linux-androideabi, i686-pc-windows-msvc
- wasm32-unknown-unknown,arm-linux-androideabi,i686-pc-windows-msvc
- wasm32-unknown-unknown,arm-linux-androideabi, i686-pc-windows-msvc
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -38,20 +41,22 @@ jobs:
toolchain: nightly
profile: minimal
override: true
targets: ${{ matrix.target }}
targets: ${{ matrix.targets }}

- name: Test ${{ matrix.target }} exists
# We check for 3 as we expect the target for the current runner + 2
# We check for 4 as we expect the target for the current runner + 3
# from the target from the matrix
run: test $(rustup target list | grep -c installed) -eq 3

run: test $(rustup target list | grep -c installed) -eq 4
install_in_docker:
name: Targets (docker)
runs-on: ubuntu-latest
strategy:
matrix:
# These are 2 more exotic targets that are not found on the runners
target:
- wasm32-unknown-unknown, arm-linux-androideabi
# Test with multiple spacing
targets:
- wasm32-unknown-unknown, arm-linux-androideabi, i686-pc-windows-msvc
- wasm32-unknown-unknown,arm-linux-androideabi,i686-pc-windows-msvc
- wasm32-unknown-unknown,arm-linux-androideabi, i686-pc-windows-msvc
# Docker image, not the GitHub Actions VM
container: ubuntu:latest
steps:
Expand All @@ -68,9 +73,9 @@ jobs:
toolchain: nightly
profile: minimal
override: true
targets: ${{ matrix.target }}
targets: ${{ matrix.targets }}

- name: Test ${{ matrix.target }} exists
# We check for 3 as we expect the target for the current runner + 2
# We check for 4 as we expect the target for the current runner + 3
# from the target from the matrix
run: test $(rustup target list | grep -c installed) -eq 3
run: test $(rustup target list | grep -c installed) -eq 4
1 change: 0 additions & 1 deletion .github/workflows/test_toolchain_input.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ jobs:
- name: Test toolchain version
run: |
test "${{ steps.toolchain.outputs.rustc }}" = "${{ matrix.toolchain }}"
install_in_docker:
runs-on: ubuntu-latest
strategy:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI Test - default input
name: CI Test - toolchain input
on:
push:
branches:
Expand All @@ -18,6 +18,7 @@ concurrency:
cancel-in-progress: true
jobs:
install_on_runner:
name: Toolchain (runner)
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -42,8 +43,8 @@ jobs:
- name: Test toolchain version
run: |
test "${{ steps.toolchain.outputs.rustc }}" = "${{ matrix.toolchain }}"
install_in_docker:
name: Toolchain (docker)
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Unit Tests
name: Unit tests
on:
push:
branches:
Expand All @@ -18,8 +18,8 @@ concurrency:
cancel-in-progress: true
jobs:
test:
name: Units tests
runs-on: ubuntu-latest
name: Test
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down

0 comments on commit b754186

Please sign in to comment.