Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit CI with github actions #41

Merged
merged 2 commits into from
Feb 19, 2025
Merged
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
74 changes: 32 additions & 42 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,51 +1,41 @@
name: CI

on:
push:
branches:
- main
pull_request:
on:
push:
branches: [main, master]
pull_request:

permissions:
actions: write
contents: read

jobs:
build:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Julia
uses: julia-actions/setup-julia@v2
with:
version: 'lts'

- name: Cache Julia packages
uses: actions/cache@v4
with:
# Cache the artifacts and compiled directories
path: |
~/.julia/artifacts
~/.julia/compiled
# Unique cache key based on the dependencies
key: ${{ runner.os }}-julia-${{ hashFiles('**/Project.toml', '**/Manifest.toml') }}
# Fallback keys if the exact cache isn't found
restore-keys: |
${{ runner.os }}-julia-

- name: Install dependencies
run: |
julia --project=. -e '
using Pkg
Pkg.instantiate()'

- name: Run tests
run: julia --project=. -e 'using Pkg; Pkg.test(coverage=true)'

- uses: julia-actions/julia-processcoverage@v1
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
- name: Set up Julia
uses: julia-actions/setup-julia@v2

- name: Cache Julia packages
uses: julia-actions/cache@v2

- name: Build package
uses: julia-actions/julia-buildpkg@v1

- name: Run tests with coverage
uses: julia-actions/julia-runtest@v1
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}


coverage: true

- name: Process coverage
uses: julia-actions/julia-processcoverage@v1

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# EXAMPLE: Harmonic Oscillator
# EXAMPLE: PGMC Harmonic Oscillator
include("../particle_1d.jl")

potential(x) = x^2
Expand Down