2021-06-13 04:37:00 +00:00
|
|
|
name: GnuTests
|
2021-01-21 07:19:08 +00:00
|
|
|
|
2021-06-12 22:34:48 +00:00
|
|
|
# spell-checker:ignore (names) gnulib ; (utils) autopoint gperf pyinotify texinfo ; (vars) XPASS
|
|
|
|
|
2021-01-21 07:19:08 +00:00
|
|
|
on: [push, pull_request]
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
gnu:
|
|
|
|
name: Run GNU tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Checkout code uutil
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
path: 'uutils'
|
2021-05-17 18:37:26 +00:00
|
|
|
- name: Checkout GNU coreutils
|
2021-01-21 07:19:08 +00:00
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
repository: 'coreutils/coreutils'
|
|
|
|
path: 'gnu'
|
2021-05-17 18:37:26 +00:00
|
|
|
ref: v8.32
|
2021-06-12 22:34:48 +00:00
|
|
|
- name: Checkout GNU coreutils library (gnulib)
|
2021-01-21 07:19:08 +00:00
|
|
|
uses: actions/checkout@v2
|
|
|
|
with:
|
|
|
|
repository: 'coreutils/gnulib'
|
|
|
|
path: 'gnulib'
|
2021-05-17 18:37:26 +00:00
|
|
|
ref: 8e99f24c0931a38880c6ee9b8287c7da80b0036b
|
2021-01-21 07:19:08 +00:00
|
|
|
fetch-depth: 0 # gnu gets upset if gnulib is a shallow checkout
|
|
|
|
- name: Install `rust` toolchain
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
default: true
|
|
|
|
profile: minimal # minimal component installation (ie, no documentation)
|
|
|
|
components: rustfmt
|
2021-06-12 22:34:48 +00:00
|
|
|
- name: Install dependencies
|
2021-01-21 07:19:08 +00:00
|
|
|
shell: bash
|
|
|
|
run: |
|
2021-06-12 22:34:48 +00:00
|
|
|
## Install dependencies
|
2021-02-03 21:27:30 +00:00
|
|
|
sudo apt-get update
|
2021-05-18 19:31:55 +00:00
|
|
|
sudo apt-get install autoconf autopoint bison texinfo gperf gcc g++ gdb python-pyinotify python3-sphinx jq
|
2021-05-21 11:27:35 +00:00
|
|
|
- name: Build binaries
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2021-06-12 22:34:48 +00:00
|
|
|
## Build binaries
|
|
|
|
cd uutils
|
|
|
|
bash util/build-gnu.sh
|
2021-01-21 22:56:02 +00:00
|
|
|
- name: Run GNU tests
|
|
|
|
shell: bash
|
|
|
|
run: |
|
2021-05-21 16:25:23 +00:00
|
|
|
bash uutils/util/run-gnu-test.sh
|
2021-06-12 22:34:48 +00:00
|
|
|
- name: Extract testing info
|
2021-02-11 14:42:41 +00:00
|
|
|
shell: bash
|
|
|
|
run: |
|
2021-06-12 22:34:48 +00:00
|
|
|
## Extract testing info
|
2021-05-18 19:31:55 +00:00
|
|
|
LOG_FILE=gnu/tests/test-suite.log
|
|
|
|
if test -f "$LOG_FILE"
|
2021-03-21 14:45:34 +00:00
|
|
|
then
|
2021-05-18 19:31:55 +00:00
|
|
|
TOTAL=$(sed -n "s/.*# TOTAL: \(.*\)/\1/p" "$LOG_FILE"|tr -d '\r'|head -n1)
|
|
|
|
PASS=$(sed -n "s/.*# PASS: \(.*\)/\1/p" "$LOG_FILE"|tr -d '\r'|head -n1)
|
|
|
|
SKIP=$(sed -n "s/.*# SKIP: \(.*\)/\1/p" "$LOG_FILE"|tr -d '\r'|head -n1)
|
|
|
|
FAIL=$(sed -n "s/.*# FAIL: \(.*\)/\1/p" "$LOG_FILE"|tr -d '\r'|head -n1)
|
|
|
|
XPASS=$(sed -n "s/.*# XPASS: \(.*\)/\1/p" "$LOG_FILE"|tr -d '\r'|head -n1)
|
|
|
|
ERROR=$(sed -n "s/.*# ERROR: \(.*\)/\1/p" "$LOG_FILE"|tr -d '\r'|head -n1)
|
2021-06-12 22:34:48 +00:00
|
|
|
output="GNU tests summary = TOTAL: $TOTAL / PASS: $PASS / FAIL: $FAIL / ERROR: $ERROR"
|
|
|
|
echo "${output}"
|
|
|
|
if [[ "$FAIL" -gt 0 || "$ERROR" -gt 0 ]]; then echo "::warning ::${output}" ; fi
|
2021-05-18 19:31:55 +00:00
|
|
|
jq -n \
|
2021-05-19 18:33:28 +00:00
|
|
|
--arg date "$(date --rfc-email)" \
|
2021-05-22 19:59:54 +00:00
|
|
|
--arg sha "$GITHUB_SHA" \
|
2021-05-18 19:31:55 +00:00
|
|
|
--arg total "$TOTAL" \
|
|
|
|
--arg pass "$PASS" \
|
|
|
|
--arg skip "$SKIP" \
|
|
|
|
--arg fail "$FAIL" \
|
|
|
|
--arg xpass "$XPASS" \
|
|
|
|
--arg error "$ERROR" \
|
2021-05-22 19:59:54 +00:00
|
|
|
'{($date): { sha: $sha, total: $total, pass: $pass, skip: $skip, fail: $fail, xpass: $xpass, error: $error, }}' > gnu-result.json
|
2021-03-21 14:45:34 +00:00
|
|
|
else
|
|
|
|
echo "::error ::Failed to get summary of test results"
|
|
|
|
fi
|
2021-02-03 21:38:24 +00:00
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: test-report
|
|
|
|
path: gnu/tests/**/*.log
|
2021-05-18 19:31:55 +00:00
|
|
|
- uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: gnu-result
|
|
|
|
path: gnu-result.json
|