Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 0 additions & 130 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,104 +11,6 @@ on:
- cron: "0 0 * * 0"

jobs:
ensure-conventions:
name: Ensure conventions are followed
runs-on: ubuntu-latest

steps:
# Checks out a copy of your repository on the ubuntu-latest machine
- name: Checkout code
uses: actions/checkout@v2

- name: Ensure src/lib.rs files exist
run: bash ./_test/ensure-lib-src-rs-exist.sh

- name: Count ignores
run: sh ./_test/count-ignores.sh

- name: Check UUIDs
run: sh ./_test/check-uuids.sh

- name: Verify exercise difficulties
run: ./_test/verify-exercise-difficulties.sh

- name: Check exercises for authors
run: ./_test/check-exercises-for-authors.sh

configlet:
name: Setup configlet
runs-on: ubuntu-latest

steps:
# Checks out master locally so that it is available to the scripts.
- name: Checkout master
uses: actions/checkout@v2
with:
ref: master

# Checks out a copy of your repository on the ubuntu-latest machine
- name: Checkout code
uses: actions/checkout@v2

- name: Fetch configlet
run: ./bin/fetch-configlet

- name: Check configlet format
run: ./_test/check-configlet-fmt.sh

- name: Ensure readmes are updated
run: sh ./_test/ensure-readmes-are-updated.sh

- name: Lint configlet
run: ./bin/configlet lint .


compilation:
name: Check compilation
runs-on: ubuntu-latest

strategy:
# Allows running the job multiple times with different configurations
matrix:
rust: ["stable", "beta"]
deny_warnings: ['', '1']

steps:
# Checks out master locally so that it is available to the scripts.
- name: Checkout master
uses: actions/checkout@v2
with:
ref: master

# Checks out a copy of your repository on the ubuntu-latest machine
- name: Checkout code
uses: actions/checkout@v2

- name: Setup toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
default: true

# run scripts as steps
- name: Check exercises
env:
DENYWARNINGS: ${{ matrix.deny_warnings }}
run: ./_test/check-exercises.sh
continue-on-error: ${{ matrix.rust == 'beta' && matrix.deny_warnings == '1' }}

- name: Ensure stubs compile
env:
DENYWARNINGS: ${{ matrix.deny_warnings }}
run: sh ./_test/ensure-stubs-compile.sh
continue-on-error: ${{ matrix.rust == 'beta' && matrix.deny_warnings == '1' }}

- name: Check exercise crate
env:
DENYWARNINGS: ${{ matrix.deny_warnings }}
run: sh ./_test/check-exercise-crate.sh
continue-on-error: ${{ matrix.rust == 'beta' && matrix.deny_warnings == '1' }}

clippy:
name: Clippy
runs-on: ubuntu-latest
Expand Down Expand Up @@ -141,35 +43,3 @@ jobs:
env:
CLIPPY: true
run: ./_test/check-exercises.sh

- name: Clippy stubs
env:
CLIPPY: true
run: sh ./_test/ensure-stubs-compile.sh

nightly-compilation:
name: Check exercises on nightly (benchmark enabled)
runs-on: ubuntu-latest
continue-on-error: true # It's okay if the nightly job fails

steps:
# Checks out master locally so that it is available to the scripts.
- name: Checkout master
uses: actions/checkout@v2
with:
ref: master

# Checks out a copy of your repository on the ubuntu-latest machine
- name: Checkout code
uses: actions/checkout@v2

- name: Setup nightly toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
default: true

- name: Check exercises
env:
BENCHMARK: '1'
run: ./_test/check-exercises.sh
2 changes: 1 addition & 1 deletion _test/check-exercises.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fi

repo=$(cd "$(dirname "$0")/.." && pwd)

if [ "$GITHUB_EVENT_NAME" = "pull_request" ]; then
if false; then
files="$(git diff --diff-filter=d --name-only remotes/origin/master | grep "exercises/" | cut -d '/' -f -2 | sort -u | awk -v repo=$repo '{print repo"/"$1}')"
else
files=$repo/exercises/*
Expand Down
3 changes: 1 addition & 2 deletions bin/test-exercise
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,8 @@ done
cd $exercise
if [ -n "$CLIPPY" ]; then
# Consider any Clippy to be an error in tests only.
# For now, not the example solutions since they have many Clippy warnings,
# and are not shown to students anyway.
sed -i -e '1i #![deny(clippy::all)]' tests/*.rs
sed -i -e '1i #![deny(clippy::all)]' src/lib.rs
cargo clippy --tests --color always "$@" 2>clippy.log
if [ $? -ne 0 ]; then
cat clippy.log
Expand Down