Skip to content

Commit

Permalink
Fix environment variables when using docker exec
Browse files Browse the repository at this point in the history
  • Loading branch information
dwoz committed Feb 12, 2025
1 parent 9771dd7 commit c6bfd96
Showing 1 changed file with 33 additions and 35 deletions.
68 changes: 33 additions & 35 deletions .github/workflows/test-packages-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,30 +139,28 @@ jobs:
docker pull ${{ matrix.container }}
- name: "Create container ${{ matrix.container }}"
#env:
# GITHUB_ACTIONS: true
# CI: true
# SKIP_REQUIREMENTS_INSTALL: 1
# PRINT_TEST_SELECTION: 0
# PRINT_TEST_PLAN_ONLY: 0
# PRINT_SYSTEM_INFO: 0
# RERUN_FAILURES: 1
# GITHUB_ACTIONS_PIPELINE: 1
# SKIP_INITIAL_ONEDIR_FAILURES: 1
# SKIP_INITIAL_GH_ACTIONS_FAILURES: 1
# SKIP_CODE_COVERAGE: ${{ inputs.skip-code-coverage && '1' || '0' }}
# CONVERAGE_CONTEXT: ${{ matrix.slug }}
# COLUMNS: 190
# PIP_INDEX_URL: "{{ vars.PIP_INDEX_URL }}"
# PIP_TRUSTED_HOST: "${{ vars.PIP_TRUSTED_HOST }}"
# PIP_EXTRA_INDEX_URL: "${{ vars.PIP_EXTRA_INDEX_URL }}"
# PIP_DISABLE_PIP_VERSION_CHECK: 1
# RAISE_DEPRECATIONS_RUNTIME_ERRORS: 1
# SALT_TRANSPORT: ${{ matrix.transport }}
#run: |
# tools container create ${{ matrix.container }} --name ${{ github.run_id }}_salt-test-pkg
run: |
/usr/bin/docker create --name ${{ github.run_id }}_salt-test-pkg --workdir /__w/salt/salt --privileged -e "HOME=/github/home" -e GITHUB_ACTIONS=true -e CI=true -v "/var/run/docker.sock":"/var/run/docker.sock" -v "/home/runner/work":"/__w" -v "/home/runner/work/_temp":"/__w/_temp" -v "/home/runner/work/_actions":"/__w/_actions" -v "/opt/hostedtoolcache":"/__t" -v "/home/runner/work/_temp/_github_home":"/github/home" -v "/home/runner/work/_temp/_github_workflow":"/github/workflow" --entrypoint "/usr/lib/systemd/systemd" ${{ matrix.container }} --systemd --unit rescue.target-
env:
GITHUB_ACTIONS: true
CI: true
SKIP_REQUIREMENTS_INSTALL: 1
PRINT_TEST_SELECTION: 0
PRINT_TEST_PLAN_ONLY: 0
PRINT_SYSTEM_INFO: 0
RERUN_FAILURES: 1
GITHUB_ACTIONS_PIPELINE: 1
SKIP_INITIAL_ONEDIR_FAILURES: 1
SKIP_INITIAL_GH_ACTIONS_FAILURES: 1
SKIP_CODE_COVERAGE: ${{ inputs.skip-code-coverage && '1' || '0' }}
CONVERAGE_CONTEXT: ${{ matrix.slug }}
COLUMNS: 190
PIP_INDEX_URL: "{{ vars.PIP_INDEX_URL }}"
PIP_TRUSTED_HOST: "${{ vars.PIP_TRUSTED_HOST }}"
PIP_EXTRA_INDEX_URL: "${{ vars.PIP_EXTRA_INDEX_URL }}"
PIP_DISABLE_PIP_VERSION_CHECK: 1
RAISE_DEPRECATIONS_RUNTIME_ERRORS: 1
SALT_TRANSPORT: ${{ matrix.transport }}
run: |
tools container create ${{ matrix.container }} --name ${{ github.run_id }}_salt-test-pkg
- name: "Start container ${{ matrix.container }}"
run: |
Expand All @@ -177,21 +175,21 @@ jobs:
df -h || true
- name: Show System Info
env:
SKIP_REQUIREMENTS_INSTALL: "1"
PRINT_SYSTEM_INFO_ONLY: "1"
run: |
docker exec ${{ github.run_id }}_salt-test-pkg python3 -m nox --force-color -e ${{ inputs.nox-session }}-pkgs -- ${{ matrix.tests-chunk }}
docker exec \
-e SKIP_REQUIREMENTS_INSTALL=1 \
-e PRINT_SYSTEM_INFO_ONLY=1 \
${{ github.run_id }}_salt-test-pkg python3 -m nox --force-color -e ${{ inputs.nox-session }}-pkgs -- ${{ matrix.tests-chunk }}
- name: Run Package Tests
env:
SKIP_REQUIREMENTS_INSTALL: "1"
RERUN_FAILURES: "1"
GITHUB_ACTIONS_PIPELINE: "1"
SKIP_INITIAL_GH_ACTIONS_FAILURES: "1"
COVERAGE_CONTEXT: ${{ matrix.slug }}
run: |
/usr/bin/docker exec ${{ github.run_id }}_salt-test-pkg \
docker exec \
-e SKIP_REQUIREMENTS_INSTALL=1 \
-e RERUN_FAILURES=1 \
-e GITHUB_ACTIONS_PIPELINE=1
-e SKIP_INITIAL_GH_ACTIONS_FAILURES=1
-e COVERAGE_CONTEXT=${{ matrix.slug }} \
${{ github.run_id }}_salt-test-pkg \
python3 -m nox --force-color -e ${{ inputs.nox-session }}-pkgs -- ${{ matrix.tests-chunk }} \
${{ matrix.version && format('--prev-version={0}', matrix.version) || ''}}
Expand Down

0 comments on commit c6bfd96

Please sign in to comment.