Merge pull request #1444 from OpenGeoscience/dependabot/github_action… #1557
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: Build and test | |
| on: | |
| push: | |
| # branches: | |
| # - master | |
| pull_request: | |
| branches: | |
| - master | |
| release: | |
| types: | |
| - created | |
| schedule: | |
| - cron: "0 7 * * 1" | |
| permissions: | |
| id-token: write | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: '20' | |
| - uses: browser-actions/setup-firefox@latest | |
| - run: sudo apt-get update | |
| - run: sudo apt-get install --yes --no-install-recommends optipng imagemagick build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev liblzma-dev | |
| - run: sudo apt-get remove --yes fonts-lato | |
| - run: fc-list | |
| - run: firefox --version | |
| - run: google-chrome --version | |
| - run: npm ci | |
| - run: npm run setup-website | |
| - run: npm run ci-xvfb | |
| - run: npm run validate-es5 | |
| - run: npm run ci-build-website | |
| - uses: codecov/codecov-action@v5 | |
| with: | |
| fail_ci_if_error: false | |
| verbose: true | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| - name: On failure, create alternate baseline images in case the new behavior is correct | |
| if: ${{ failure() }} | |
| run: | | |
| pip3 install girder_client | |
| python3 tests/runners/baseline_images.py -cevb _build | |
| - name: Upload test images on failure | |
| if: ${{ failure() }} | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: images | |
| path: | | |
| _build/images | |
| _build/Baseline*tgz | |
| - name: Upload artifacts | |
| if: ${{ always() }} | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: dist | |
| path: | | |
| dist/apidocs | |
| dist/built | |
| - name: Upload built website | |
| if: ${{ success() }} | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: website | |
| path: | | |
| website/public | |
| unpinned: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| # Don't pin version to test with the latest common version | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 'lts/*' | |
| - run: npm --version && node --version | |
| - uses: browser-actions/setup-firefox@latest | |
| - run: sudo apt-get update | |
| - run: sudo apt-get install --yes --no-install-recommends optipng imagemagick build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev liblzma-dev | |
| - run: sudo apt-get remove --yes fonts-lato | |
| - run: fc-list | |
| - run: firefox --version | |
| - run: google-chrome --version | |
| # Delete the package-lock to test with the latest libraries allowed | |
| - run: rm package-lock.json | |
| - run: npm install | |
| - run: npm audit --audit-level high | |
| - run: npm run setup-website | |
| - run: npm run ci-xvfb | |
| - run: npm run ci-build-website | |
| deploy-website: | |
| if: ${{ github.ref == 'refs/heads/master' }} | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Import artifacts | |
| uses: actions/download-artifact@v6 | |
| with: | |
| name: website | |
| path: website/public | |
| - name: Deploy | |
| uses: peaceiris/actions-gh-pages@v4 | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| publish_dir: website/public | |
| force_orphan: true | |
| deploy-npm: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version: 'lts/*' | |
| registry-url: 'https://registry.npmjs.org' | |
| - run: sudo apt-get update | |
| - run: sudo apt-get install --yes --no-install-recommends optipng imagemagick build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev liblzma-dev | |
| - name: Import artifacts | |
| uses: actions/download-artifact@v6 | |
| with: | |
| name: dist | |
| path: dist | |
| - name: Copy built artifacts into package root (skip rebuild) | |
| run: | | |
| if [ -d "dist/built" ]; then | |
| cp -a dist/built/. . | |
| else | |
| echo "ERROR: dist/built not found; aborting publish" | |
| exit 1 | |
| fi | |
| - name: Install semantic-release | |
| run: npm install semantic-release --no-save | |
| - name: Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| NPM_CONFIG_IGNORE_SCRIPTS: 'true' | |
| run: npx semantic-release |