TMP: test the node_modules named volume approach #869
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
name: Verify Docker Image | |
on: | |
pull_request: | |
branches: | |
- master | |
env: | |
PROCESS_COUNT: auto | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
outputs: | |
version: ${{ steps.build.outputs.version }} | |
steps: | |
- uses: actions/checkout@v4 | |
- id: build | |
uses: ./.github/actions/build-docker | |
with: | |
target: development | |
push: true | |
username: ${{ secrets.DOCKER_USER }} | |
password: ${{ secrets.DOCKER_PASS }} | |
check: | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- uses: actions/checkout@v4 | |
- id: failure | |
uses: ./.github/actions/run-docker | |
with: | |
version: ${{ needs.build.outputs.version }} | |
command: | | |
exit 1 | |
continue-on-error: true | |
- name: Verify failure | |
if: always() | |
run: | | |
if [ "${{ steps.failure.outcome }}" -ne "failure" ]; then | |
echo "Expected failure" | |
exit 1 | |
fi | |
- name: Check (special characters in command) | |
uses: ./.github/actions/run-docker | |
with: | |
version: ${{ needs.build.outputs.version }} | |
command: | | |
echo 'this is a question?' | |
echo 'a * is born' | |
echo 'wow an array []' | |
- name: Manage py check | |
uses: ./.github/actions/run-docker | |
with: | |
version: ${{ needs.build.outputs.version }} | |
command: | | |
echo 'from olympia.lib.settings_base import *' > settings_local.py | |
DJANGO_SETTINGS_MODULE='settings_local' python3 ./manage.py check | |
- name: Installed packages | |
uses: ./.github/actions/run-docker | |
with: | |
version: ${{ needs.build.outputs.version }} | |
command: | | |
pip show olympia | |
./scripts/check_requirements_installed.sh prod.txt | |
./scripts/check_requirements_installed.sh pip.txt | |
./scripts/check_requirements_installed.sh dev.txt | |
main: | |
runs-on: ubuntu-latest | |
needs: [build] | |
strategy: | |
matrix: | |
group: [1, 2, 3, 4, 5] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: test_durations | |
- name: Pytest (main) | |
uses: ./.github/actions/run-docker | |
with: | |
version: ${{ needs.build.outputs.version }} | |
up: '' | |
command: | | |
pytest \ | |
-n ${{ env.PROCESS_COUNT }} \ | |
--splits 5 \ | |
--group ${{ matrix.group }} \ | |
-m 'not es_tests and not static_assets and not internal_routes_allowed' \ | |
-v src/olympia/ \ | |
--ignore src/olympia/devhub/ \ | |
--ignore src/olympia/reviewers/ \ | |
--ignore src/olympia/amo/ \ | |
--ignore src/olympia/lib/ \ | |
--ignore src/olympia/signing \ | |
--ignore src/olympia/zadmin | |
devhub: | |
runs-on: ubuntu-latest | |
needs: [build] | |
strategy: | |
matrix: | |
group: [1, 2, 3, 4, 5] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Pytest (devhub) | |
uses: ./.github/actions/run-docker | |
with: | |
version: ${{ needs.build.outputs.version }} | |
up: '' | |
command: | | |
pytest \ | |
-n ${{ env.PROCESS_COUNT }} \ | |
--splits 5 \ | |
--group ${{ matrix.group }} \ | |
-m 'not es_tests and not needs_locales_compilation and not static_assets' \ | |
-v src/olympia/devhub/ | |
es-tests: | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Pytest (es-testst) | |
uses: ./.github/actions/run-docker | |
with: | |
version: ${{ needs.build.outputs.version }} | |
up: '' | |
command: | | |
./docker/healthcheck.mjs elastic 60 | |
# EStests seem to fail when using -n in github actions. | |
pytest \ | |
-m 'es_tests and not needs_locales_compilation and not static_assets' \ | |
-v src/olympia/ | |
signing: | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Pytest (signing) | |
uses: ./.github/actions/run-docker | |
with: | |
version: ${{ needs.build.outputs.version }} | |
up: '' | |
command: | | |
pytest \ | |
-m 'not es_tests and not needs_locales_compilation and not static_assets' \ | |
-v src/olympia/amo/ src/olympia/lib/ src/olympia/signing | |
zadmin: | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Pytest (zadmin) | |
uses: ./.github/actions/run-docker | |
with: | |
version: ${{ needs.build.outputs.version }} | |
up: '' | |
command: | | |
pytest \ | |
-n ${{ env.PROCESS_COUNT }} \ | |
-m 'not es_tests and not needs_locales_compilation and not static_assets' \ | |
-v src/olympia/reviewers/ src/olympia/zadmin/ | |
reviewers: | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Pytest (reviewers) | |
uses: ./.github/actions/run-docker | |
with: | |
version: ${{ needs.build.outputs.version }} | |
up: '' | |
command: | | |
# We need to change the setting in the file because we can't | |
# override an env variable here, and the next command requires | |
# `INTERNAL_ROUTES_ALLOWED` to be set to `True`. | |
sed -i 's/^INTERNAL_ROUTES_ALLOWED.*/INTERNAL_ROUTES_ALLOWED=True/' settings_test.py | |
pytest \ | |
-n ${{ env.PROCESS_COUNT }} \ | |
-m 'internal_routes_allowed' \ | |
-v src/olympia/ | |
codestyle: | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Lint and codestyle | |
uses: ./.github/actions/run-docker | |
with: | |
version: ${{ needs.build.outputs.version }} | |
command: | | |
make lint-codestyle | |
assets: | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Static Assets | |
uses: ./.github/actions/run-docker | |
with: | |
version: ${{ needs.build.outputs.version }} | |
command: | | |
make update_assets | |
pytest \ | |
-n ${{ env.PROCESS_COUNT }} \ | |
-m 'static_assets' -v src/olympia/ | |
make run_js_tests | |
locales: | |
runs-on: ubuntu-latest | |
needs: [build] | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
ref: ${{ github.event.pull_request.head.ref }} | |
repository: ${{github.event.pull_request.head.repo.full_name}} | |
- name: Extract Locales | |
uses: ./.github/actions/run-docker | |
with: | |
version: ${{ needs.build.outputs.version }} | |
copy: true | |
command: | | |
make extract_locales | |
- name: Push Locales (dry-run) | |
if: github.event_name == 'pull_request' | |
shell: bash | |
run: | | |
if [[ ${{ github.event.pull_request.head.repo.fork}} == 'true' ]]; then | |
echo """ | |
Github actions are not authorized to push from workflows triggered by forks. | |
We cannot verify if the l10n extraction push will work or not. | |
Please submit a PR from the base repository if you are modifying l10n extraction scripts. | |
""" | |
exit 0 | |
fi | |
make push_locales ARGS="--dry-run" |