|
84 | 84 | - name: Install Python and Dependencies |
85 | 85 | uses: conda-incubator/setup-miniconda@v3 |
86 | 86 | with: |
87 | | - miniforge-variant: Mambaforge |
88 | 87 | miniforge-version: latest |
89 | | - use-mamba: true |
90 | 88 | environment-file: envs/testing.yml |
91 | 89 | python-version: ${{ matrix.python-version }} |
92 | 90 | activate-environment: testing-env |
@@ -169,3 +167,90 @@ jobs: |
169 | 167 | with: |
170 | 168 | user: __token__ |
171 | 169 | password: ${{ secrets.PYPI_API_TOKEN }} |
| 170 | + activitysim-examples: |
| 171 | + # test that updates to sharrow will not break the activitysim canonical examples |
| 172 | + needs: fmt |
| 173 | + env: |
| 174 | + python-version: "3.10" |
| 175 | + label: linux-64 |
| 176 | + strategy: |
| 177 | + matrix: |
| 178 | + include: |
| 179 | + - region: ActivitySim 1-Zone Example (MTC) |
| 180 | + region-org: ActivitySim |
| 181 | + region-repo: activitysim-prototype-mtc |
| 182 | + region-branch: extended |
| 183 | + - region: ActivitySim 2-Zone Example (SANDAG) |
| 184 | + region-org: ActivitySim |
| 185 | + region-repo: sandag-abm3-example |
| 186 | + region-branch: main |
| 187 | + fail-fast: false |
| 188 | + defaults: |
| 189 | + run: |
| 190 | + shell: bash -l {0} |
| 191 | + name: ${{ matrix.region }} |
| 192 | + runs-on: ubuntu-latest |
| 193 | + steps: |
| 194 | + - name: Checkout Sharrow |
| 195 | + uses: actions/checkout@v4 |
| 196 | + with: |
| 197 | + path: 'sharrow' |
| 198 | + |
| 199 | + - name: Checkout ActivitySim |
| 200 | + uses: actions/checkout@v4 |
| 201 | + with: |
| 202 | + repository: 'ActivitySim/activitysim' |
| 203 | + ref: 'main' |
| 204 | + path: 'activitysim' |
| 205 | + |
| 206 | + - name: Setup Miniforge |
| 207 | + uses: conda-incubator/setup-miniconda@v3 |
| 208 | + with: |
| 209 | + miniforge-version: latest |
| 210 | + activate-environment: asim-test |
| 211 | + python-version: ${{ env.python-version }} |
| 212 | + |
| 213 | + - name: Set cache date for year and month |
| 214 | + run: echo "DATE=$(date +'%Y%m')" >> $GITHUB_ENV |
| 215 | + |
| 216 | + - uses: actions/cache@v4 |
| 217 | + with: |
| 218 | + path: | |
| 219 | + ${{ env.CONDA }}/envs |
| 220 | + ~/.cache/ActivitySim |
| 221 | + key: ${{ env.label }}-conda-${{ hashFiles('activitysim/conda-environments/github-actions-tests.yml') }}-${{ env.DATE }}-${{ env.CACHE_NUMBER }} |
| 222 | + id: cache |
| 223 | + |
| 224 | + - name: Update environment |
| 225 | + run: | |
| 226 | + conda env update -n asim-test -f activitysim/conda-environments/github-actions-tests.yml |
| 227 | + if: steps.cache.outputs.cache-hit != 'true' |
| 228 | + |
| 229 | + - name: Install sharrow |
| 230 | + # installing from source |
| 231 | + run: | |
| 232 | + python -m pip install ./sharrow |
| 233 | +
|
| 234 | + - name: Install activitysim |
| 235 | + # installing without dependencies is faster, we trust that all needed dependencies |
| 236 | + # are in the conda environment defined above. Also, this avoids pip getting |
| 237 | + # confused and reinstalling tables (pytables). |
| 238 | + run: | |
| 239 | + python -m pip install ./activitysim --no-deps |
| 240 | +
|
| 241 | + - name: Conda checkup |
| 242 | + run: | |
| 243 | + conda info -a |
| 244 | + conda list |
| 245 | +
|
| 246 | + - name: Checkout Example |
| 247 | + uses: actions/checkout@v4 |
| 248 | + with: |
| 249 | + repository: '${{ matrix.region-org }}/${{ matrix.region-repo }}' |
| 250 | + ref: '${{ matrix.region-branch }}' |
| 251 | + path: '${{ matrix.region-repo }}' |
| 252 | + |
| 253 | + - name: Test ${{ matrix.region }} |
| 254 | + run: | |
| 255 | + cd ${{ matrix.region-repo }}/test |
| 256 | + python -m pytest . |
0 commit comments