Merge pull request #149 from ProvideQ/fix/gams-update #680
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: 'CI/CD' | |
| on: | |
| push: | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| container: | |
| image: debian:bookworm-slim # use the same image as our docker runner | |
| steps: | |
| - name: Clone repo (shallow) | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Set up GAMS | |
| shell: bash # required for the source command | |
| env: | |
| GAMS_LICENSE: ${{ secrets.GAMS_LICENSE }} | |
| run: | | |
| source ./scripts/setup-gams.sh | |
| echo "/opt/conda/bin" >> "$GITHUB_PATH" | |
| echo "$GAMS_PATH" >> "$GITHUB_PATH" | |
| echo "GMSPYTHONLIB=/opt/conda/envs/gams/lib/libpython3.10.so" >> "$GITHUB_ENV" | |
| - name: Cache Venv dependencies | |
| uses: actions/cache@v4 | |
| with: | |
| path: ${{ github.workspace }}/venv | |
| # update venv when setup script or any solver has changed: | |
| key: venv-${{ runner.os }}-${{ hashFiles('scripts/ci-setup-solvers.sh', 'solvers/**') }} | |
| restore-keys: | | |
| venv-${{ runner.os }}- | |
| - name: Install solver dependencies | |
| run: ./scripts/ci-setup-solvers.sh | |
| - name: Run checks | |
| shell: bash # required for the source command | |
| run: | # change to "./gradlew check --info" for more debugging output. | |
| source /opt/conda/bin/activate gams | |
| ./gradlew check | |
| - name: Archive test reports | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-report | |
| path: build/reports/tests/test/ | |
| - name: Archive style reports | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: style-report | |
| path: build/reports/checkstyle/ | |
| deploy-staging: | |
| runs-on: ubuntu-latest | |
| needs: check | |
| if: ${{ github.ref == 'refs/heads/develop' }} | |
| steps: | |
| - name: Clone repo (shallow) | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Push to dokku | |
| uses: dokku/github-action@master | |
| with: | |
| branch: develop | |
| # only extracting the server address to a secret avoids leaking it in the logs | |
| git_remote_url: ssh://dokku@${{ secrets.DOKKU_SERVER_ADDRESS }}/toolbox-backend-staging | |
| ssh_private_key: ${{ secrets.DOKKU_DEPLOYMENT_KEY }} |