Upgrade crates (tendril, cargo-suity, smartstring, html5ever/xml5ever) #297
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
pull_request: {} | |
push: | |
branches: | |
- master | |
- ci/* | |
env: | |
CARGO_TERM_COLOR: always | |
RUST_BACKTRACE: '1' | |
# Cancel any in-flight jobs for the same PR/branch so there's only one active | |
# at a time | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
cargo_test: | |
name: Cargo Test | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: install rust nightly-2021-10-07 | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly-2021-10-07 | |
override: true | |
- uses: Swatinem/rust-cache@v1 | |
- run: cargo test --lib | |
- run: cargo test --doc | |
- run: cargo test -p citeproc-io --test integration | |
regressions: | |
name: CSL Test Suite Regressions | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
with: | |
submodules: recursive | |
- name: Extract branch name | |
id: branch | |
shell: bash | |
env: | |
GITHUB_HEAD: ${{ github.head_ref }} | |
GITHUB_BASE: ${{ github.base_ref }} | |
run: | | |
IS_CI_TEST=${{ github.event_name == 'push' && github.ref != 'refs/heads/master' && 'true' || 'false '}} | |
if test -z "$GITHUB_HEAD"; then | |
GITHUB_HEAD="$GITHUB_REF" | |
fi | |
if test -z "$GITHUB_BASE"; then | |
GITHUB_BASE="$GITHUB_REF" | |
fi | |
# transforms refs/pulls/123/merge into pulls-123-merge | |
GITHUB_HEAD=${GITHUB_HEAD#refs/heads/} | |
GITHUB_HEAD=$(echo "${GITHUB_HEAD#refs/}" | tr '/' '-') | |
echo "GITHUB_HEAD = ${GITHUB_HEAD}" | |
echo "::set-output name=head::${GITHUB_HEAD}" | |
if $IS_CI_TEST; then | |
echo "::set-output name=base::master" | |
else | |
GITHUB_BASE=${GITHUB_BASE#refs/heads/} | |
GITHUB_BASE=$(echo "${GITHUB_BASE#refs/}" | tr '/' '-') | |
echo "GITHUB_BASE = ${GITHUB_BASE}" | |
echo "::set-output name=base::${GITHUB_BASE}" | |
fi | |
- name: > | |
Plan: compare ${{ steps.branch.outputs.head }} to ${{ steps.branch.outputs.base }} | |
run: echo | |
- name: Download base output | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_DEFAULT_REGION: ap-southeast-2 | |
GITHUB_BASE: ${{ steps.branch.outputs.base }} | |
GITHUB_HEAD: ${{ steps.branch.outputs.head }} | |
run: | | |
mkdir -p .snapshots/branches | |
mkdir -p test-results | |
S3_PREFIX='https://citeproc-rs-test-results.cormacrelf.net' | |
curl -sL "$S3_PREFIX/.snapshots/branches/$GITHUB_BASE" -o ".snapshots/branches/$GITHUB_BASE" | |
- name: install rust nightly-2021-10-07 | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly-2021-10-07 | |
override: true | |
- uses: Swatinem/rust-cache@v1 | |
- name: "Build tools package" | |
run: cargo build --package tools | |
- name: "Pull locales" | |
run: cargo pull-locales | |
- name: "Log test suite results" | |
run: cargo test-suite store | |
- name: "Compare test suite results for regressions" | |
env: | |
GITHUB_BASE: ${{ steps.branch.outputs.base }} | |
GITHUB_HEAD: ${{ steps.branch.outputs.head }} | |
shell: bash | |
run: | | |
cp .snapshots/current ".snapshots/branches/$GITHUB_HEAD" | |
cargo test-suite diff "$GITHUB_BASE..$GITHUB_HEAD" | tee test-results/diff | |
# need the first command in the pipe, $? would give us tee's status | |
echo "${PIPESTATUS[0]}" > test-results/diff-status | |
- name: "Write the test-results artifact files" | |
if: always() | |
env: | |
PR_NUM: ${{ github.event.number }} | |
GITHUB_HEAD: ${{ steps.branch.outputs.head }} | |
run: | | |
mkdir -p test-results | |
test -f .snapshots/current && cp .snapshots/current test-results/snapshot || echo "" > test-results/snapshot | |
if ${{ github.event_name == 'pull_request' && 'true' || 'false'}}; then | |
echo "$PR_NUM" > test-results/pr-number | |
echo "pulls/$PR_NUM" > test-results/name | |
fi | |
if ${{github.event_name == 'push' && 'true' || 'false'}}; then | |
echo "branches/$GITHUB_HEAD" > test-results/name | |
# DEBUGGING ONLY: write to an old PR | |
# echo "1" > test-results/pr-number | |
fi | |
- name: "Upload test result artifacts (GitHub Actions)" | |
if: always() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: test-results | |
path: | | |
test-results/* | |
# i.e. | |
# test-results/pr-number | |
# test-results/name | |
# test-results/diff | |
# test-results/diff-status | |
# test-results/snapshot | |
wasm_tests: | |
name: "Test the WASM package" | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: ./.github/actions/setup-rust-wasm | |
- name: Get yarn cache directory path | |
id: yarn-cache-dir-path | |
run: echo "::set-output name=dir::$(yarn cache dir)" | |
- name: Restore yarn cache | |
uses: actions/cache@v2 | |
id: yarn-cache | |
with: | |
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.os }}-yarn- | |
- name: Yarn install | |
working-directory: crates/wasm/js-tests | |
run: yarn install | |
- name: Build WASM | |
working-directory: crates/wasm/js-tests | |
run: yarn build | |
- name: Download Firefox ESR from zotero-standalone-build | |
working-directory: crates/wasm/js-tests | |
run: ./install_firefox.sh | |
- name: Run tests, including in Firefox ESR | |
working-directory: crates/wasm/js-tests | |
run: MUST_RUN_FIREFOX_TESTS=1 yarn test | |
# not necessary because we install @citeproc-rs/wasm without yarn knowing now | |
# # otherwise, the yarn cache will contain a different @citeproc-rs/wasm | |
# # entry every time. | |
# - name: Clean yarn cache dir of wasm output | |
# run: | | |
# cd "$(yarn cache dir)" | |
# ls | grep citeproc-rs-wasm | xargs rm -rf | |