Skip to content

taxonomy: translation czech #44556

taxonomy: translation czech

taxonomy: translation czech #44556

Workflow file for this run

name: Pull Request checks
on:
pull_request:
# we can't do that, because status are required
# see https://stackoverflow.com/questions/66751567/return-passing-status-on-github-workflow-when-using-paths-ignore
# paths-ignore:
# - "**.md"
# - ".github/CODEOWNERS"
# - ".github/PULL_REQUEST_TEMPLATE.md"
# - ".editorconfig"
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# FIXME: not used yet
filter:
name: "Filter changed paths"
runs-on: ubuntu-latest
outputs:
code_modified: ${{ steps.filter.outputs.code_modified }}
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Get changed files
uses: step-security/changed-files@v46
id: changed_files
- name: Filter non-markdown and non-docs files
id: filter
run: ./.github/scripts/path-filter.sh "${{ steps.changed_files.outputs.all_changed_files }}"
lint:
name: 🕵️‍♀️ NPM lint
needs: filter
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && needs.filter.outputs.code_modified == 'true'
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 1
- uses: actions/setup-node@v4
with:
node-version: '22.x'
- name: Cache node modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: gulp build
run: make front_build
- name: lint
run: make front_lint
- name: Verify package-lock is the right one
run: |
cp package-lock.json package-lock.json.orig
make update_package_lock
if ! diff -q package-lock.json.orig package-lock.json
then
echo "Package lock is not up to date, please run make update_package_lock"
diff -u package-lock.json.orig package-lock.json
exit 1
fi
# this will build the docker image and upload as an artifact for following jobs
build_backend:
name: 🏗 Build backend dev image for tests
needs: filter
runs-on: ubuntu-latest
if: ((github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'pull_request') && needs.filter.outputs.code_modified == 'true'
steps:
- uses: actions/checkout@v5
with:
# needs depth to run git log below
fetch-depth: 50
- uses: actions/cache@v4
id: cache
with:
path: ./build-cache
key: taxonomies-${{ hashFiles('taxonomies/**') }}
restore-keys: taxonomies-
- name: build
run: make build container=backend
- name: Free disk space
run: |
echo "Before cleanup:"
df -h
docker system prune -f || true
sudo rm -rf /usr/local/lib/android || true
sudo rm -rf /opt/ghc || true
sudo rm -rf /usr/share/dotnet || true
sudo rm -rf /usr/local/share/boost || true
echo "After cleanup:"
df -h
- name: push backend image as artifact
uses: ishworkh/[email protected]
with:
image: "openfoodfacts-server/backend:dev"
- name: Setup Git and Restore Taxonomies
run: ./.github/scripts/setup_git.sh
- name: Rebuild taxonomies for Open Food Facts (off)
run: make DOCKER_LOCAL_DATA="$(pwd)" build_taxonomies GITHUB_TOKEN="${{ secrets.TAXONOMY_CACHE_GITHUB_TOKEN }}"
- name: Rebuild taxonomies for Open Beauty Facts (obf)
run: |
source env/setenv.sh obf
make DOCKER_LOCAL_DATA="$(pwd)" build_taxonomies GITHUB_TOKEN="${{ secrets.TAXONOMY_CACHE_GITHUB_TOKEN }}"
- name: Rebuild taxonomies for Open Products Facts (opf)
run: |
source env/setenv.sh opf
make DOCKER_LOCAL_DATA="$(pwd)" build_taxonomies GITHUB_TOKEN="${{ secrets.TAXONOMY_CACHE_GITHUB_TOKEN }}"
- name: Rebuild taxonomies for Open Pet Food Facts (opff)
run: |
source env/setenv.sh opff
make DOCKER_LOCAL_DATA="$(pwd)" build_taxonomies GITHUB_TOKEN="${{ secrets.TAXONOMY_CACHE_GITHUB_TOKEN }}"
check_perl:
name: 🐪 Check Perl
needs: [filter, build_backend]
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && needs.filter.outputs.code_modified == 'true'
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 1
- name: Setup Git and Restore Taxonomies
run: ./.github/scripts/setup_git.sh
- uses: actions/cache/restore@v4
id: cache
with:
path: ./build-cache
key: taxonomies-${{ hashFiles('taxonomies/**') }}
restore-keys: taxonomies-
- name: Download backend image from artifacts
id: downloadbackendimage
uses: ishworkh/[email protected]
with:
image: "openfoodfacts-server/backend:dev"
download_tmp_dir: ${{ runner.temp }}
- name: build taxonomies (should use cache)
run: make DOCKER_LOCAL_DATA="$(pwd)" build_taxonomies GITHUB_TOKEN="${{ secrets.TAXONOMY_CACHE_GITHUB_TOKEN }}"
- name: check taxonomies
run: make check_taxonomies
- name: check perltidy
run: make check_perltidy
- name: check perlcritic
run: make check_critic
- name: check perl
run: make check_perl
tests:
name: 🐪 Perl unit tests
needs: [filter, build_backend]
runs-on: ubuntu-latest
if: ((github.event_name == 'push' && github.ref == 'refs/heads/main') || github.event_name == 'pull_request') && needs.filter.outputs.code_modified == 'true'
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 1
- uses: actions/cache/restore@v4
id: cache
with:
path: ./build-cache
key: taxonomies-${{ hashFiles('taxonomies/**') }}
restore-keys: taxonomies-
- name: Setup Git and Restore Taxonomies
run: ./.github/scripts/setup_git.sh
- name: Download backend image from artifacts
id: downloadbackendimage
uses: ishworkh/[email protected]
with:
image: "openfoodfacts-server/backend:dev"
download_tmp_dir: ${{ runner.temp }}
- name: tests
run: |
make codecov_prepare
make COVER_OPTS='-e HARNESS_PERL_SWITCHES="-MDevel::Cover=+ignore,tests/"' DOCKER_LOCAL_DATA="$(pwd)" tests GITHUB_TOKEN="${{ secrets.TAXONOMY_CACHE_GITHUB_TOKEN }}"
- name: generate coverage results
# even if tests failed
if: always()
run: |
make coverage_txt
make codecov
- uses: codecov/codecov-action@v5
if: always()
with:
files: cover_db/codecov.json
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./tests/unit/outputs/junit.xml,./tests/integration/outputs/junit.xml
tests_dev:
name: 🧪 Test make dev
needs: [filter, build_backend] # build_backend - only to avoid building taxonomies
if: github.event_name == 'pull_request' && needs.filter.outputs.code_modified == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 1
- uses: actions/cache/restore@v4
id: cache
with:
path: ./build-cache
key: taxonomies-${{ hashFiles('taxonomies/**') }}
restore-keys: taxonomies-
- name: Download backend image from artifacts
id: downloadbackendimage
uses: ishworkh/[email protected]
with:
image: "openfoodfacts-server/backend:dev"
download_tmp_dir: ${{ runner.temp }}
- name: set right UID and GID in .envrc
run: |
rm -f .envrc
echo "export USER_UID=$(id -u)" >> .envrc
echo "export USER_GID=$(id -g)" >> .envrc
- name: Test make dev
run: |
make DOCKER_LOCAL_DATA="$(pwd)" SKIP_SAMPLE_IMAGES=1 dev_no_build
make status
- name: Test all is running
run: make livecheck || ( tail -n 300 logs/apache2/*error*log; docker compose logs; false )
- name: test clean
run: make hdown
test_deployment:
name: 🦾 Some test of deployment tools
needs: filter
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && needs.filter.outputs.code_modified == 'true'
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 1
- name: verify apache2 envvars is correct
run: |
env/setenv.sh off;
sh -c ". conf/apache-2.4/off-envvars"
sh -c "APACHE_CONFDIR=/etc/apache2-priority; . conf/apache-2.4/off-envvars"