CI #1488
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 | |
| on: | |
| push: | |
| branches: [ master, dev ] | |
| pull_request: | |
| branches: | |
| - '**' | |
| schedule: | |
| - cron: '0 0 * * 0' | |
| jobs: | |
| deploy-assets: | |
| name: Deploy Assets | |
| runs-on: ubuntu-20.04 | |
| env: | |
| PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| submodules: 'recursive' | |
| - run: ./ci/deploy_assets.sh | |
| docker-build: | |
| name: Docker Build | |
| runs-on: ubuntu-20.04 | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| submodules: 'recursive' | |
| fetch-depth: 0 # fetch all history for all branches and tags | |
| - name: Push to Docker Hub | |
| uses: docker/build-push-action@v1 | |
| with: | |
| push: true | |
| tags: "GITHUB_ACTION_${{ github.run_number }}" | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| repository: mmore500/dishtiny | |
| add_git_labels: true | |
| tidy: | |
| name: Tidy | |
| runs-on: ubuntu-20.04 | |
| needs: | |
| - docker-build | |
| container: | |
| image: mmore500/dishtiny:GITHUB_ACTION_${{ github.run_number }} | |
| # github actions requires root to access mounted volumes | |
| options: --user root | |
| steps: | |
| - run: | | |
| cd /opt/dishtiny | |
| ./ci/test_tidy.sh | |
| docs: | |
| name: Docs | |
| runs-on: ubuntu-20.04 | |
| needs: | |
| - docker-build | |
| container: | |
| image: mmore500/dishtiny:GITHUB_ACTION_${{ github.run_number }} | |
| # github actions requires root to access mounted volumes | |
| options: --user root | |
| steps: | |
| - run: | | |
| cd /opt/dishtiny | |
| make docs | |
| python3 ci/test_readme_snippets.py | |
| py-unit: | |
| name: Python Unit Tests | |
| runs-on: ubuntu-20.04 | |
| needs: | |
| - docker-build | |
| container: | |
| image: mmore500/dishtiny:GITHUB_ACTION_${{ github.run_number }} | |
| # github actions requires root to access mounted volumes | |
| options: --user root --cap-add=SYS_ADMIN | |
| env: | |
| DISH_MPICXX: mpicxx.openmpi | |
| OMPI_CXX: clang++ | |
| steps: | |
| - run: /opt/dishtiny/dishpylib/test/run_tests.sh | |
| cpp-unit: | |
| name: C++ Unit Tests | |
| runs-on: ubuntu-20.04 | |
| needs: | |
| - docker-build | |
| strategy: | |
| matrix: | |
| cxx: [clang++, g++] | |
| mode: [ "", opt] | |
| fail-fast: false | |
| container: | |
| image: mmore500/dishtiny:GITHUB_ACTION_${{ github.run_number }} | |
| # github actions requires root to access mounted volumes | |
| options: --user root --cap-add=SYS_ADMIN | |
| env: | |
| DISH_MPICXX: mpicxx.openmpi | |
| OMPI_CXX: ${{ matrix.cxx }} | |
| steps: | |
| - run: | | |
| set -x | |
| cd /opt/dishtiny/tests/dish2 | |
| make ${{ matrix.mode }} | |
| source: | |
| name: Source | |
| runs-on: ubuntu-20.04 | |
| needs: | |
| - docker-build | |
| strategy: | |
| matrix: | |
| cxx: [clang++, g++] | |
| mode: [ "", opt] | |
| fail-fast: false | |
| container: | |
| image: mmore500/dishtiny:GITHUB_ACTION_${{ github.run_number }} | |
| options: --user user --cap-add=SYS_ADMIN | |
| env: | |
| DISH_MPICXX: mpicxx.openmpi | |
| OMPI_CXX: ${{ matrix.cxx }} | |
| steps: | |
| # undo github actions override of HOME to "/home/github/" | |
| - run: | | |
| export HOME="/home/user/" | |
| set -x | |
| make -C /opt/dishtiny/ test-source | |
| make -C /opt/dishtiny/tests/source | |
| make -C /opt/dishtiny/tests/source ${{ matrix.mode }} | |
| coverage: | |
| name: Coverage | |
| runs-on: ubuntu-20.04 | |
| needs: | |
| - docker-build | |
| container: | |
| image: mmore500/dishtiny:GITHUB_ACTION_${{ github.run_number }} | |
| # github actions requires root to access mounted volumes | |
| options: --user root --cap-add=SYS_ADMIN | |
| env: | |
| DISH_MPICXX: mpicxx.openmpi | |
| OMPI_CXX: clang++ | |
| steps: | |
| - run: "make coverage -C /opt/dishtiny/tests/dish2/" | |
| - uses: codecov/codecov-action@v1 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos | |
| fail_ci_if_error: true | |
| verbose: true | |
| directory: /opt/dishtiny | |
| fuzzing: | |
| name: Fuzzing | |
| runs-on: ubuntu-20.04 | |
| needs: | |
| - docker-build | |
| container: | |
| image: mmore500/dishtiny:GITHUB_ACTION_${{ github.run_number }} | |
| # github actions requires root to access mounted volumes | |
| options: --user root --cap-add=SYS_ADMIN --cap-add=SYS_PTRACE --security-opt seccomp=unconfined | |
| steps: | |
| - run: | | |
| cd /opt/dishtiny/fuzzing | |
| make | |
| make opt | |
| microbenchmarks: | |
| name: Microbenchmarks | |
| runs-on: ubuntu-20.04 | |
| needs: | |
| - docker-build | |
| container: | |
| image: mmore500/dishtiny:GITHUB_ACTION_${{ github.run_number }} | |
| # github actions requires root to access mounted volumes | |
| options: --user root --cap-add=SYS_ADMIN | |
| env: | |
| CONTEXT: actions | |
| DISH_MPICXX: mpicxx.openmpi | |
| OMPI_CXX: clang++ | |
| OSF_USERNAME: ${{ secrets.OSF_USERNAME }} | |
| OSF_PASSWORD: ${{ secrets.OSF_PASSWORD }} | |
| steps: | |
| - run: | | |
| cd /opt/dishtiny/microbenchmarks | |
| make | |
| binder: | |
| name: Notebooks | |
| runs-on: ubuntu-20.04 | |
| needs: | |
| - docker-build | |
| container: | |
| image: mmore500/dishtiny:GITHUB_ACTION_${{ github.run_number }} | |
| env: | |
| AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} | |
| AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| OSF_PASSWORD: ${{ secrets.OSF_PASSWORD }} | |
| OSF_USERNAME: ${{ secrets.OSF_USERNAME }} | |
| # github actions requires root to access mounted volumes | |
| options: --user root | |
| steps: | |
| # Adapted from https://askubuntu.com/a/524368 | |
| - run: cd /opt/dishtiny/binder && ./execute_notebooks.sh | |
| - run: git init | |
| - uses: fregante/setup-git-user@v1 | |
| - run: git commit --allow-empty -m "Initial commit" | |
| - run: cp -r /opt/dishtiny/ deploy/ | |
| - uses: JamesIves/github-pages-deploy-action@4.0.0 | |
| with: | |
| branch: binder # The branch the action should deploy to. | |
| folder: deploy # The folder the action should deploy. | |
| deploy-pages: | |
| name: Deploy to GitHub Pages | |
| runs-on: ubuntu-20.04 | |
| if: github.ref == 'refs/heads/master' | |
| needs: | |
| - binder | |
| - coverage | |
| - cpp-unit | |
| - docs | |
| - fuzzing | |
| - microbenchmarks | |
| - py-unit | |
| - source | |
| - tidy | |
| container: | |
| image: mmore500/dishtiny:GITHUB_ACTION_${{ github.run_number }} | |
| env: | |
| OSF_PASSWORD: ${{ secrets.OSF_PASSWORD }} | |
| OSF_USERNAME: ${{ secrets.OSF_USERNAME }} | |
| # github actions requires root to access mounted volumes | |
| options: --user root | |
| steps: | |
| # fix for https://github.com/mmore500/dishtiny/runs/2146191664?check_suite_focus=true#step:7:1 | |
| # /usr/bin/git config user.name mmore500 | |
| # fatal: not in a git directory | |
| - run: git init | |
| - uses: fregante/setup-git-user@v1 | |
| - run: git commit --allow-empty -m "Initial commit" | |
| - run: make -C /opt/dishtiny/ web-deploy | |
| - run: make -C /opt/dishtiny/ badges | |
| - run: git clone https://github.com/mmore500/dishtiny.git -b web-archive deploy/ | |
| - run: cp -r /opt/dishtiny/web/ deploy/master/ | |
| - uses: JamesIves/github-pages-deploy-action@4.0.0 | |
| with: | |
| branch: gh-pages # The branch the action should deploy to. | |
| folder: deploy # The folder the action should deploy. | |
| clean: true # Automatically remove deleted files from the deploy branch | |
| deploy-dockerhub: | |
| name: Deploy to DockerHub | |
| runs-on: ubuntu-20.04 | |
| needs: | |
| - binder | |
| - coverage | |
| - cpp-unit | |
| - docs | |
| - fuzzing | |
| - microbenchmarks | |
| - py-unit | |
| - source | |
| - tidy | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| submodules: 'recursive' | |
| fetch-depth: 0 # fetch all history for all branches and tags | |
| - name: Push to DockerHub | |
| uses: docker/build-push-action@v1 | |
| with: | |
| push: true | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| repository: mmore500/dishtiny | |
| tag_with_ref: true | |
| tag_with_sha: true | |
| add_git_labels: true |