Skip to content

Commit

Permalink
Move effect of "set -x" into default shell command
Browse files Browse the repository at this point in the history
This also adds "--noprofile --norc" to the Cygwin shell command
as a speed optimization (bash doesn't need to source its scripts).
That only changes the Cygwin workflow; in the Ubuntu workflow,
"--noprofile --norc" had already been included by default when no
shell was specified, so having it there is to *keep* the optimized
behavior that was already in use.
  • Loading branch information
EliahKagan committed Sep 11, 2023
1 parent 4eef3ec commit 5f128e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
11 changes: 3 additions & 8 deletions .github/workflows/cygwin-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
TEMP: "/tmp"
defaults:
run:
shell: bash.exe -eo pipefail -o igncr "{0}"
shell: bash.exe --noprofile --norc -exo pipefail -o igncr "{0}"

steps:
- name: Force LF line endings
Expand All @@ -31,23 +31,19 @@ jobs:

- name: Show python and git versions
run: |
set -x
/usr/bin/python --version
/usr/bin/git version
- name: Tell git to trust this repo
run: |
/usr/bin/git config --global --add safe.directory "$(pwd)"
/usr/bin/git config --global --add safe.directory "$(pwd)"
- name: Prepare this repo for tests
run: |
set -x
TRAVIS=yes ./init-tests-after-clone.sh
- name: Further prepare git configuration for tests
run: |
set -x
/usr/bin/git config --global user.email "travis@ci.com"
/usr/bin/git config --global user.name "Travis Runner"
# If we rewrite the user's config by accident, we will mess it up
Expand All @@ -56,14 +52,13 @@ jobs:
- name: Update PyPA packages
run: |
set -x
/usr/bin/python -m pip install --upgrade pip setuptools wheel
- name: Install project and test dependencies
run: |
set -x
/usr/bin/python -m pip install ".[test]"
- name: Test with pytest
run: |
set +x
/usr/bin/python -m pytest
13 changes: 3 additions & 10 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ jobs:
- experimental: false
- python-version: "3.12"
experimental: true
defaults:
run:
shell: /bin/bash --noprofile --norc -exo pipefail {0}

steps:
- uses: actions/checkout@v4
Expand All @@ -35,19 +38,15 @@ jobs:

- name: Show python and git versions
run: |
set -x
python --version
git version
- name: Prepare this repo for tests
run: |
set -x
TRAVIS=yes ./init-tests-after-clone.sh
- name: Prepare git configuration for tests
run: |
set -x
git config --global user.email "travis@ci.com"
git config --global user.name "Travis Runner"
# If we rewrite the user's config by accident, we will mess it up
Expand All @@ -56,8 +55,6 @@ jobs:
- name: Update PyPA packages
run: |
set -x
python -m pip install --upgrade pip
if pip freeze --all | grep --quiet '^setuptools=='; then
# Python prior to 3.12 ships setuptools. Upgrade it if present.
Expand All @@ -67,25 +64,21 @@ jobs:
- name: Install project and test dependencies
run: |
set -x
pip install ".[test]"
- name: Check types with mypy
run: |
set -x
mypy -p git
# With new versions of mypy new issues might arise. This is a problem if there is nobody able to fix them,
# so we have to ignore errors until that changes.
continue-on-error: true

- name: Test with pytest
run: |
set -x
pytest
continue-on-error: false

- name: Documentation
run: |
set -x
pip install -r doc/requirements.txt
make -C doc html

0 comments on commit 5f128e8

Please sign in to comment.