Skip to content

Commit

Permalink
ci: build and test exercises in CI (#15)
Browse files Browse the repository at this point in the history
Resolves #7.
  • Loading branch information
ruancomelli authored Aug 24, 2023
1 parent 1883418 commit 93d0965
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Continuous Integration

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

env:
CARGO_TERM_COLOR: always

jobs:
find-exercises:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- id: find-exercises
run: |
echo \
"exercises=$(ls exercism/rust | jq -R -s -c 'split("\n")[:-1]')" \
>> "$GITHUB_OUTPUT"
outputs:
exercises: ${{ steps.find-exercises.outputs.exercises }}

build-and-test:
name: Build and test '${{ matrix.exercise }}'
needs: find-exercises
runs-on: ubuntu-latest
strategy:
matrix:
exercise: ${{ fromJson(needs.find-exercises.outputs.exercises) }}

steps:
- uses: actions/checkout@v3
- name: Build '${{ matrix.exercise }}'
run: cargo build --verbose
working-directory: exercism/rust/${{ matrix.exercise }}
- name: Run tests for '${{ matrix.exercise }}'
run: cargo test --verbose
working-directory: exercism/rust/${{ matrix.exercise }}

0 comments on commit 93d0965

Please sign in to comment.