Skip to content

Commit

Permalink
ci: use outputs instead of env
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhewitt committed Mar 4, 2021
1 parent e55d980 commit 6068cd6
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,26 +84,35 @@ jobs:
name: Prepare LD_LIBRARY_PATH (Ubuntu only)
run: echo LD_LIBRARY_PATH=${pythonLocation}/lib >> $GITHUB_ENV

# On PyPy can't execute tests because no embedding API.
- if: matrix.python-version == 'pypy-3.6'
name: Set cargo to build only (PyPy only)
- name: Prepare workflow settings
id: settings
shell: bash
run: echo CARGO_COMMAND="cargo build --lib --tests --no-default-features --verbose" >> $GITHUB_ENV
run: |
if [[ $PYPY == "true" ]]
then
# On PyPy can't execute tests because no embedding API.
echo "::set-output name=cargo_command::cargo build --lib --tests --no-default-features --verbose"
else
echo "::set-output name=cargo_command::cargo test --no-default-features --verbose"
fi
echo "::set-output name=all_additive_features::macros num-bigint num-complex hashbrown serde"
env:
PYPY: ${{ matrix.python-version == 'pypy-3.6' }}

- name: Build docs
run: cargo doc --no-default-features --features "${{ env.ALL_ADDITIVE_FEATURES }}" --verbose
run: cargo doc --no-default-features --features "${{ steps.settings.outputs.all_additive_features }}" --verbose

- name: Test (no features)
run: ${{ env.CARGO_COMMAND }}
run: ${{ steps.settings.outputs.cargo_command }}

- name: Test (all additive features)
run: ${{ env.CARGO_COMMAND }} --features "${{ env.ALL_ADDITIVE_FEATURES }}"
run: ${{ steps.settings.outputs.cargo_command }} --features "${{ steps.settings.outputs.all_additive_features }}"

- name: Test (abi3)
run: ${{ env.CARGO_COMMAND }} --features "abi3 ${{ env.ALL_ADDITIVE_FEATURES }}"
run: ${{ steps.settings.outputs.cargo_command }} --features "abi3 ${{ steps.settings.outputs.all_additive_features }}"

- name: Test (minimum supported abi3 version)
run: ${{ env.CARGO_COMMAND }} --features "abi3-py36 ${{ env.ALL_ADDITIVE_FEATURES }}"
run: ${{ steps.settings.outputs.cargo_command }} --features "abi3-py36 ${{ steps.settings.outputs.all_additive_features }}"

- name: Test proc-macro code
run: cargo test --manifest-path=pyo3-macros-backend/Cargo.toml
Expand All @@ -125,8 +134,6 @@ jobs:
CARGO_BUILD_TARGET: ${{ matrix.platform.rust-target }}
RUST_BACKTRACE: 1
RUSTFLAGS: "-D warnings"
ALL_ADDITIVE_FEATURES: "macros num-bigint num-complex hashbrown serde"
CARGO_COMMAND: cargo test --no-default-features --verbose
# TODO: this is a hack to workaround compile_error! warnings about auto-initialize on PyPy
# Once cargo's `resolver = "2"` is stable (~ MSRV Rust 1.52), remove this.
PYO3_CI: 1
Expand Down

0 comments on commit 6068cd6

Please sign in to comment.