diff --git a/.github/workflows/Benchmark.yml b/.github/workflows/Benchmark.yml index 7427941a7..98e0276a1 100644 --- a/.github/workflows/Benchmark.yml +++ b/.github/workflows/Benchmark.yml @@ -4,10 +4,22 @@ on: pull_request: branches: - master + workflow_dispatch: jobs: - run-benchmark: - runs-on: ubuntu-latest + benchmark: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macOS-latest] + include: + - os: macOS-latest + arch: aarch64 + - os: ubuntu-latest + arch: x64 + + name: Benchmark on ${{ matrix.os }} + runs-on: ${{ matrix.os }} steps: - name: Checkout code @@ -19,19 +31,52 @@ jobs: uses: julia-actions/setup-julia@v2 with: version: '1' + arch: ${{ matrix.arch }} + + - uses: actions/cache@v4 + with: + path: | + ~/.julia + ~/.julia/artifacts + key: ${{ runner.os }}-julia-benchmark-${{ matrix.arch }}-${{ hashFiles('**/Project.toml', '**/Manifest.toml') }} + restore-keys: | + ${{ runner.os }}-julia-benchmark-${{ matrix.arch }}- + ${{ runner.os }}-julia-benchmark- - name: Run benchmarks run: | julia --project=benchmark -e 'using Pkg; Pkg.instantiate()' - julia --project=benchmark benchmark/run_benchmarks.jl > benchmark_results.txt + julia --project=benchmark benchmark/run_benchmarks.jl > benchmark_results_${{ matrix.os }}.txt - name: Upload benchmark results uses: actions/upload-artifact@v4 with: - name: benchmark-results - path: benchmark_results.txt + name: benchmark-results-${{ matrix.os }} + path: benchmark_results_${{ matrix.os }}.txt + retention-days: 7 + + post-results: + needs: benchmark + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + + steps: + - name: Download all benchmark results + uses: actions/download-artifact@v4 + + - name: Combine benchmark results + run: | + echo "Benchmark results on macOS (aarch64)" > combined_benchmark_results.txt + echo "" >> combined_benchmark_results.txt + cat benchmark-results-macOS-latest/benchmark_results_macOS-latest.txt >> combined_benchmark_results.txt + echo "" >> combined_benchmark_results.txt + echo "Benchmark results on Ubuntu (x64)" >> combined_benchmark_results.txt + echo "" >> combined_benchmark_results.txt + cat benchmark-results-ubuntu-latest/benchmark_results_ubuntu-latest.txt >> combined_benchmark_results.txt + echo "" >> combined_benchmark_results.txt - - name: Post results to PR + - name: Post combined results to PR uses: marocchino/sticky-pull-request-comment@v2 with: - path: benchmark_results.txt \ No newline at end of file + path: combined_benchmark_results.txt + recreate: true \ No newline at end of file diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index d4b0d847a..d14e73273 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -16,14 +16,14 @@ jobs: fail-fast: false matrix: version: ['1', '1.9', 'nightly'] - os: [ubuntu-latest, macOS-latest, windows-latest] + os: [ubuntu-latest, windows-latest] arch: [x64] include: - version: '1' os: ubuntu-latest arch: x64 coverage: true - + steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/TestsMacOS.yml b/.github/workflows/TestsMacOS.yml new file mode 100644 index 000000000..466335611 --- /dev/null +++ b/.github/workflows/TestsMacOS.yml @@ -0,0 +1,82 @@ +name: Tests + +on: + push: + branches: ["master"] + pull_request: + + workflow_dispatch: + +jobs: + test: + name: Julia ${{ matrix.version }} on ${{ matrix.os }} (${{ matrix.arch }}) + runs-on: ${{ matrix.os }} + continue-on-error: ${{ matrix.version == 'nightly' }} + strategy: + fail-fast: false + matrix: + version: ['1', '1.9', 'nightly'] + os: [macOS-latest] + arch: [aarch64] + + steps: + - uses: actions/checkout@v4 + + - uses: julia-actions/setup-julia@v2 + with: + version: ${{ matrix.version }} + arch: ${{ matrix.arch }} + + - uses: actions/cache@v4 + with: + path: | + ~/.julia + ~/.julia/artifacts + key: ${{ runner.os }}-julia-${{ matrix.version }}-${{ matrix.arch }}-${{ hashFiles('**/Project.toml', '**/Manifest.toml') }} + restore-keys: | + ${{ runner.os }}-julia-${{ matrix.version }}-${{ matrix.arch }}- + ${{ runner.os }}-julia-${{ matrix.version }}- + + - uses: julia-actions/julia-buildpkg@v1 + + - name: Running elementary tests + uses: julia-actions/julia-runtest@v1 + env: + TEST_GROUP: "elementary" + + - name: Running compilation tests + uses: julia-actions/julia-runtest@v1 + env: + TEST_GROUP: "compilation" + + - name: Running `gibbs` tests + uses: nick-fields/retry@v3 + with: + timeout_minutes: 10 + max_attempts: 3 + command: julia --color=yes --project=. -e "import Pkg; Pkg.instantiate(); Pkg.test(coverage=true);" + env: + TEST_GROUP: "gibbs" + + - name: Running `mcmchains` tests + uses: nick-fields/retry@v3 + with: + timeout_minutes: 10 + max_attempts: 3 + command: julia --color=yes --project=. -e "import Pkg; Pkg.instantiate(); Pkg.test(coverage=true);" + env: + TEST_GROUP: "mcmchains" + + - uses: julia-actions/julia-processcoverage@v1 + if: matrix.coverage + + - uses: codecov/codecov-action@v4 + if: matrix.coverage + with: + file: lcov.info + + - uses: coverallsapp/github-action@master + if: matrix.coverage + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + path-to-lcov: lcov.info