diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..c2d240c6 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,34 @@ +name: asv + +# CI ASV CHECK is aimed to verify that the benchmarks execute without error. +on: [pull_request, push] + +jobs: + quick: + runs-on: ubuntu-latest + defaults: + run: + shell: bash -el {0} + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Install Python + uses: actions/setup-python@v3 + with: + python-version: '3.9.7' + + - name: Install asv + run: pip install asv==0.4.2 + + - name: Run asv benchmarks + run: | + cd benchmarks + asv machine --yes + asv run HEAD^! --quick --dry-run --show-stderr | sed "/failed$/ s/^/##[error]/" | tee benchmarks.log + if grep "failed" benchmarks.log > /dev/null ; then + exit 1 + fi + diff --git a/benchmarks/asv.conf.json b/benchmarks/asv.conf.json index 443636cf..878175d3 100644 --- a/benchmarks/asv.conf.json +++ b/benchmarks/asv.conf.json @@ -13,7 +13,6 @@ // project being benchmarked "repo": "..", - "branches": "main", // The Python project's subdirectory in your repo. If missing or // the empty string, the project is assumed to be located at the root diff --git a/benchmarks/benchmarks/solarposition.py b/benchmarks/benchmarks/solarposition.py index cddf8bed..71bc3070 100644 --- a/benchmarks/benchmarks/solarposition.py +++ b/benchmarks/benchmarks/solarposition.py @@ -101,9 +101,9 @@ def time_sun_rise_set_transit_geometric_full_comparison(self, ndays): self.times_daily, self.lat, self.lon, declination, equationoftime) - # def time_sun_rise_set_transit_ephem(self, ndays): - # solarposition.sun_rise_set_transit_ephem( - # self.times_daily, self.lat, self.lon) + def time_sun_rise_set_transit_ephem(self, ndays): + solarposition.sun_rise_set_transit_ephem( + self.times_daily, self.lat, self.lon) class SolarPositionCalcTime: