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
1035
+
# run: git checkout ${{ github.head_ref }}
1036
+
1037
+
- name: Initialize workflow variables
1038
+
id: vars
1039
+
shell: bash
1040
+
run: |
1041
+
## VARs setup
1042
+
outputs() { step_id="${{ github.action }}"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; }
1043
+
1044
+
# toolchain
1045
+
TOOLCHAIN="nightly" ## default to "nightly" toolchain (required for certain required unstable compiler flags) ## !maint: refactor when stable channel has needed support
1046
+
1047
+
# * specify gnu-type TOOLCHAIN for windows; `grcov` requires gnu-style code coverage data files
1048
+
case ${{ matrix.job.os }} in windows-*) TOOLCHAIN="$TOOLCHAIN-x86_64-pc-windows-gnu" ;; esac;
1049
+
1050
+
# * use requested TOOLCHAIN if specified
1051
+
if [ -n "${{ matrix.job.toolchain }}" ]; then TOOLCHAIN="${{ matrix.job.toolchain }}" ; fi
1052
+
outputs TOOLCHAIN
1053
+
1054
+
# target-specific options
1055
+
1056
+
# * CARGO_FEATURES_OPTION
1057
+
CARGO_FEATURES_OPTION='--all-features' ; ## default to '--all-features' for code coverage
1058
+
if [ -n "${{ matrix.job.features }}" ]; then CARGO_FEATURES_OPTION='--features=${{ matrix.job.features }}' ; fi
1059
+
outputs CARGO_FEATURES_OPTION
1060
+
1061
+
# * CODECOV_FLAGS
1062
+
CODECOV_FLAGS=$( echo "${{ matrix.job.os }}" | sed 's/[^[:alnum:]]/_/g' )
1063
+
outputs CODECOV_FLAGS
1064
+
1065
+
- name: Install/setup prerequisites
1066
+
shell: bash
1067
+
run: |
1068
+
## Install/setup prerequisites
1069
+
case '${{ matrix.job.os }}' in
1070
+
macos-latest) brew install coreutils ;; # needed for testing
1071
+
esac
1072
+
1073
+
case '${{ matrix.job.os }}' in
1074
+
ubuntu-latest)
1075
+
# pinky is a tool to show logged-in users from utmp, and gecos fields from /etc/passwd.
1076
+
# In GitHub Action *nix VMs, no accounts log in, even the "runner" account that runs the commands. The account also has empty gecos fields.
1077
+
# 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`
1095
+
rustup component add llvm-tools
1096
+
1097
+
- name: Run test and coverage
1098
+
id: run_test_cov
1099
+
run: |
1100
+
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