Skip to content

Added api endpoint to fetch email addresses #34

Added api endpoint to fetch email addresses

Added api endpoint to fetch email addresses #34

Workflow file for this run

name: Build
on:
push:
branches: [main]
pull_request:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
attestations: write
id-token: write
timeout-minutes: 120
env:
RUSTFLAGS: "-D warnings"
strategy:
fail-fast: false
matrix:
channel:
- "rust-toolchain"
name: Build and Test ${{ matrix.channel }}
steps:
- name: "Checkout"
uses: actions/checkout@v4
- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: "Show environment"
run: |
rustc -vV
cargo -vV
- name: "Enable Rust Caching"
uses: Swatinem/rust-cache@v2
- name: "Cache Tarpaulin"
id: cache-tarpaulin
uses: actions/cache@v4
with:
path: ~/.cargo/bin/cargo-tarpaulin
key: ${{ runner.os }}-tarpaulin
- name: "Install Tarpaulin"
if: steps.cache-tarpaulin.outputs.cache-hit != 'true'
run: cargo install cargo-tarpaulin
- name: "Run Tests"
id: tests
run: cargo test
- name: "Run Coverage"
id: coverage
run: cargo tarpaulin --out xml --out html
- name: "Upload Coverage"
uses: actions/upload-artifact@v4
with:
name: code-coverage-report
path: |
tarpaulin-report.xml
tarpaulin-report.html
- name: "Run Clippy"
id: clippy
run: cargo clippy -- -D warnings
- name: "Run Formatter"
id: formatting
run: cargo fmt -- --check
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push Docker image
id: push
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: "Some checks failed"
if: ${{ failure() }}
run: |
echo "### :x: Checks Failed!" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "|Job|Status|" >> $GITHUB_STEP_SUMMARY
echo "|---|------|" >> $GITHUB_STEP_SUMMARY
echo "|test |${{ steps.tests.outcome }}|" >> $GITHUB_STEP_SUMMARY
echo "|clippy |${{ steps.clippy.outcome }}|" >> $GITHUB_STEP_SUMMARY
echo "|fmt|${{ steps.formatting.outcome }}|" >> $GITHUB_STEP_SUMMARY
echo "|dockerbuild|${{ steps.dockerbuild.outcome }}|" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "Please check the failed jobs and fix where needed." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
exit 1
- name: "All checks passed"
if: ${{ success() }}
run: |
echo "### :tada: Checks Passed!" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
- name: "Generate artifact attestation"
uses: actions/attest-build-provenance@v2
with:
subject-name: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME}}
subject-digest: ${{ steps.push.outputs.digest }}
push-to-registry: true