Skip to content

Add cater waiter concept exercise #934

Add cater waiter concept exercise

Add cater waiter concept exercise #934

Workflow file for this run

name: Exercise CI
on:
workflow_dispatch:
push:
branches:
- main
paths:
- "exercises/**"
- "runtests.jl"
- ".github/workflows/exercise-tests.yml"
pull_request:
paths:
- "exercises/**"
- "runtests.jl"
- ".github/workflows/exercise-tests.yml"
jobs:
test:
name: Julia ${{ matrix.julia-version }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
julia-version: ["1.10", "1.11", nightly]
os: [ubuntu-22.04, windows-2022, macos-14]
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871
- uses: julia-actions/setup-julia@9b79636afcfb07ab02c256cede01fe2db6ba808c
with:
version: ${{ matrix.julia-version }}
- uses: julia-actions/cache@824243901fb567ccb490b0d0e2483ccecde46834
- name: Install test dependencies
run: julia --color=yes --project -e "using Pkg; Pkg.instantiate()"
- name: Test exercises
run: julia --color=yes --project runtests.jl
test-runner:
name: Julia Test Runner
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871
- name: Pull julia-test-runner image
run: docker pull exercism/julia-test-runner
- name: Install Julia dependencies
run: julia --color=yes --project -e "using Pkg; Pkg.instantiate()"
- name: Generate test reports using julia-test-runner
id: generate-reports
run: julia --color=yes --project runtestrunner.jl
- name: Upload reports as artifact
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874
with:
name: test-reports
path: ${{ steps.generate-reports.outputs.results-path }}
- name: Check if all tests passed
run: |
using JSON
any_errors = false
for report in readdir(ENV["RESULTS"])
result = JSON.parsefile(joinpath(ENV["RESULTS"], report))
if result["status"] != "pass"
global any_errors = true
@error "Exercise failed tests" report
run(`jq -C '.' $(joinpath(ENV["RESULTS"], report))`)
end
end
any_errors && exit(1)
env:
RESULTS: ${{ steps.generate-reports.outputs.results-path }}
shell: julia --color=yes --project {0}