|
1 | 1 | name: Build and deploy |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: |
5 | | - pull_request: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - "master" |
| 8 | + workflow_dispatch: |
6 | 9 |
|
7 | 10 | env: |
8 | 11 | source-directory: $GITHUB_WORKSPACE |
@@ -36,23 +39,40 @@ jobs: |
36 | 39 |
|
37 | 40 | - uses: conda-incubator/setup-miniconda@v3 |
38 | 41 | with: |
39 | | - activate-environment: campo |
40 | | - environment-file: environment/configuration/conda_environment.yaml |
| 42 | + activate-environment: campo_dev |
| 43 | + environment-file: environment/configuration/campo_dev.yaml |
41 | 44 | python-version: 3.11 |
42 | 45 | auto-activate-base: false |
43 | 46 |
|
44 | | - - name: Build |
| 47 | + - name: Configure Campo |
45 | 48 | shell: bash -l {0} |
46 | 49 | run: | |
47 | 50 | mkdir ${{ env.build-directory }} |
| 51 | + cmake \ |
| 52 | + -S ${{ env.source-directory }} \ |
| 53 | + -B ${{ env.build-directory }} \ |
| 54 | + -D CAMPO_BUILD_WHEEL=ON |
| 55 | +
|
| 56 | + - name: Build Campo |
| 57 | + shell: bash -l {0} |
| 58 | + run: | |
| 59 | + cmake --build ${{ env.build-directory }} --target documentation |
| 60 | + cmake --build ${{ env.build-directory }} --target install |
| 61 | + rm -f ${{ env.build-directory }}/package/dist/*gz |
| 62 | +
|
| 63 | + - name: Test Campo |
| 64 | + shell: bash -l {0} |
| 65 | + run: | |
| 66 | + ctest --test-dir ${{ env.build-directory }} --output-on-failure |
| 67 | +
|
| 68 | + - name: Deploy documentation |
| 69 | + if: github.repository == 'computationalgeography/campo' && github.ref == 'refs/heads/master' |
| 70 | + run: | |
48 | 71 | cd ${{ env.build-directory }} |
49 | | - cmake ${{ env.source-directory }} -DCAMPO_BUILD_WHEEL=ON |
50 | | - make documentation |
51 | | - make install |
52 | | - rm -f package/dist/*gz |
| 72 | + # lftp -c "open --user ${{ env.ftp_username }} --password ${{ env.ftp_password }} -p ${{ env.ftp_port }} ${{ env.ftp_server }};set sftp:auto-confirm yes;set ssl:verify-certificate false;mirror --verbose --reverse --continue --parallel=2 documentation/_build/ ${{ env.remote_dir1 }}" |
53 | 73 |
|
54 | 74 | - name: Deploy wheel |
55 | | - if: github.repository == 'computationalgeography/campo' |
| 75 | + if: github.repository == 'computationalgeography/campo' && github.ref == 'refs/heads/master' |
56 | 76 | run: | |
57 | 77 | mkdir -p $HOME/.ssh |
58 | 78 | echo "HostKeyAlgorithms ssh-rsa" >> $HOME/.ssh/config |
|
61 | 81 | cd ${{ env.build-directory }} |
62 | 82 | lftp -c "open --user ${{ env.ftp_username }} --password ${{ env.ftp_password }} -p ${{ env.ftp_port }} ${{ env.ftp_server }};set sftp:auto-confirm yes;set ssl:verify-certificate false;mirror --verbose --reverse --continue package/dist/ ${{ env.remote_dir2 }}" |
63 | 83 |
|
64 | | - - name: Deploy documentation |
65 | | - if: github.repository == 'computationalgeography/campo' && github.ref == 'refs/heads/master' |
66 | | - run: | |
67 | | - cd ${{ env.build-directory }} |
68 | | - # lftp -c "open --user ${{ env.ftp_username }} --password ${{ env.ftp_password }} -p ${{ env.ftp_port }} ${{ env.ftp_server }};set sftp:auto-confirm yes;set ssl:verify-certificate false;mirror --verbose --reverse --continue --parallel=2 documentation/_build/ ${{ env.remote_dir1 }}" |
69 | | -
|
70 | 84 | - name: Deploy development documentation |
71 | | - if: github.repository == 'computationalgeography/campo' |
| 85 | + if: github.repository == 'computationalgeography/campo' && github.ref == 'refs/heads/master' |
72 | 86 | run: | |
73 | 87 | cd ${{ env.build-directory }} |
74 | 88 | lftp -c "open --user ${{ env.ftp_username }} --password ${{ env.ftp_password }} -p ${{ env.ftp_port }} ${{ env.ftp_server }};set sftp:auto-confirm yes;set ssl:verify-certificate false;mirror --verbose --reverse --continue --parallel=2 documentation/_build/ ${{ env.remote_dir3 }}" |
0 commit comments