feat: changing speed and rpm to floats #290
Workflow file for this run
This file contains 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
# yamllint disable rule:line-length | |
--- | |
name: Docker | |
on: # yamllint disable-line rule:truthy | |
pull_request: | |
branches: ['*'] | |
jobs: | |
docker-build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # Fetch full history for rebase | |
- name: Configure Git Safe Directory | |
run: | | |
git config --global --add safe.directory $(pwd) | |
- name: Set Git user identity | |
run: | | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions" | |
- name: Fetch main branch | |
run: | | |
git fetch origin main | |
- name: Rebase PR branch onto main | |
run: | | |
git rebase origin/main || (git rebase --abort && exit 1) | |
- name: Find affected files | |
run: | | |
git fetch origin ${{ github.base_ref }} --depth=1 | |
git diff --diff-filter=ACM --name-only origin/${{ github.base_ref }} > affected_files.txt | |
echo "Affected files:" | |
cat affected_files.txt | |
- name: Find affected cpp files | |
run: | | |
echo "dockerfile_changed=false" >> $GITHUB_ENV | |
while read file; do | |
if [[ "$file" == Dockerfile ]]; then | |
echo "dockerfile_changed=true" >> $GITHUB_ENV | |
fi | |
done < affected_files.txt | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v2 | |
if: env.dockerfile_changed == 'true' | |
- name: Build Docker image | |
if: env.dockerfile_changed == 'true' | |
run: docker build -t test-image:latest . | |
- name: Clean up Docker image | |
if: env.dockerfile_changed == 'true' | |
run: docker rmi test-image:latest | |
- name: Skip message (if no changes) | |
if: env.dockerfile_changed == 'false' | |
run: echo "Skipping Docker build as no changes to Dockerfile were detected." |