You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# - name: Reattach HEAD ## may be needed for accurate code coverage info
1031
+
# run: git checkout ${{ github.head_ref }}
1032
+
1033
+
- name: Initialize workflow variables
1034
+
id: vars
1035
+
shell: bash
1036
+
run: |
1037
+
## VARs setup
1038
+
outputs() { step_id="${{ github.action }}"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
1039
+
1040
+
# toolchain
1041
+
TOOLCHAIN="nightly" ## default to "nightly" toolchain (required for certain required unstable compiler flags) ## !maint: refactor when stable channel has needed support
1042
+
1043
+
# * specify gnu-type TOOLCHAIN for windows; `grcov` requires gnu-style code coverage data files
1044
+
case ${{ matrix.job.os }} in windows-*) TOOLCHAIN="$TOOLCHAIN-x86_64-pc-windows-gnu" ;; esac;
1045
+
1046
+
# * use requested TOOLCHAIN if specified
1047
+
if [ -n "${{ matrix.job.toolchain }}" ]; then TOOLCHAIN="${{ matrix.job.toolchain }}" ; fi
1048
+
outputs TOOLCHAIN
1049
+
1050
+
# target-specific options
1051
+
1052
+
# * CARGO_FEATURES_OPTION
1053
+
CARGO_FEATURES_OPTION='--all-features' ; ## default to '--all-features' for code coverage
1054
+
if [ -n "${{ matrix.job.features }}" ]; then CARGO_FEATURES_OPTION='--features=${{ matrix.job.features }}' ; fi
1055
+
outputs CARGO_FEATURES_OPTION
1056
+
1057
+
# * CODECOV_FLAGS
1058
+
CODECOV_FLAGS=$( echo "${{ matrix.job.os }}" | sed 's/[^[:alnum:]]/_/g' )
1059
+
outputs CODECOV_FLAGS
1060
+
1061
+
- name: Install/setup prerequisites
1062
+
shell: bash
1063
+
run: |
1064
+
## Install/setup prerequisites
1065
+
case '${{ matrix.job.os }}' in
1066
+
macos-latest) brew install coreutils ;; # needed for testing
1067
+
esac
1068
+
1069
+
case '${{ matrix.job.os }}' in
1070
+
ubuntu-latest)
1071
+
# pinky is a tool to show logged-in users from utmp, and gecos fields from /etc/passwd.
1072
+
# In GitHub Action *nix VMs, no accounts log in, even the "runner" account that runs the commands. The account also has empty gecos fields.
1073
+
# To work around this for pinky tests, we create a fake login entry for the GH runner account...
## Install the llvm-tools component to get access to `llvm-profdata`
1091
+
rustup component add llvm-tools
1092
+
1093
+
- name: Run test and coverage
1094
+
id: run_test_cov
1095
+
run: |
1096
+
outputs() { step_id="${{ github.action }}"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
0 commit comments