name: Code Coverage env: CARGO_TERM_COLOR: always ACTION_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} RUSTFLAGS: "-C target-cpu=native" on: # Allows you to run this workflow manually from the Actions tab as an alternative. workflow_dispatch: # All the inputs are provided by Slab inputs: instance_id: description: "AWS instance ID" type: string instance_image_id: description: "AWS instance AMI ID" type: string instance_type: description: "AWS instance product type" type: string runner_name: description: "Action runner name" type: string request_id: description: 'Slab request ID' type: string fork_repo: description: 'Name of forked repo as user/repo' type: string fork_git_sha: description: 'Git SHA to checkout from fork' type: string jobs: code-coverage: concurrency: group: ${{ github.workflow }}_${{ github.ref }}_${{ inputs.instance_image_id }}_${{ inputs.instance_type }} cancel-in-progress: true runs-on: ${{ inputs.runner_name }} steps: # Step used for log purpose. - name: Instance configuration used run: | echo "ID: ${{ inputs.instance_id }}" echo "AMI: ${{ inputs.instance_image_id }}" echo "Type: ${{ inputs.instance_type }}" echo "Request ID: ${{ inputs.request_id }}" echo "Fork repo: ${{ inputs.fork_repo }}" echo "Fork git sha: ${{ inputs.fork_git_sha }}" - name: Checkout tfhe-rs uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 with: repository: ${{ inputs.fork_repo }} ref: ${{ inputs.fork_git_sha }} - name: Set up home run: | echo "HOME=/home/ubuntu" >> "${GITHUB_ENV}" - name: Install latest stable uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af with: toolchain: stable default: true - name: Check for file changes id: changed-files uses: tj-actions/changed-files@246636f5fa148b5ad8e65ca4c57b18af3123e5f6 with: files_yaml: | tfhe: - tfhe/src/** concrete_csprng: - concrete-csprng/src/** - name: Generate Keys run: | make GEN_KEY_CACHE_COVERAGE_ONLY=TRUE gen_key_cache - name: Run shortint coverage if: steps.changed-files.outputs.tfhe_any_changed == 'true' run: | make test_shortint_cov - name: Upload tfhe coverage to Codecov uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d if: steps.changed-files.outputs.tfhe_any_changed == 'true' with: token: ${{ secrets.CODECOV_TOKEN }} fail_ci_if_error: true files: ./coverage/shortint/cobertura.xml - name: Slack Notification if: ${{ failure() }} continue-on-error: true uses: rtCamp/action-slack-notify@12e36fc18b0689399306c2e0b3e0f2978b7f1ee7 env: SLACK_COLOR: ${{ job.status }} SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }} SLACK_ICON: https://pbs.twimg.com/profile_images/1274014582265298945/OjBKP9kn_400x400.png SLACK_MESSAGE: "Code coverage finished with status: ${{ job.status }}. (${{ env.ACTION_RUN_URL }})" SLACK_USERNAME: ${{ secrets.BOT_USERNAME }} SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}