Skip to content

Commit

Permalink
Merge branch 'main' into add-debug-to-rBinaryPath-search
Browse files Browse the repository at this point in the history
  • Loading branch information
cderv authored Aug 24, 2023
2 parents bba12ab + 62f7b33 commit ff53e41
Show file tree
Hide file tree
Showing 351 changed files with 14,987 additions and 5,125 deletions.
42 changes: 32 additions & 10 deletions .github/actions/docker/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,9 @@ runs:
using: "composite"
steps:
- shell: bash
run: echo "BASE_NM=ghcr.io/${{ inputs.org }}/${{ inputs.name }}" >> $GITHUB_ENV

- name: Create DockerFile
shell: bash
run: |
cat << 'EOF' >> Dockerfile
FROM ubuntu:22.04
COPY ["${{ inputs.source }}", "quarto-linux-amd64.deb"]
RUN dpkg -i quarto-linux-amd64.deb && rm quarto-linux-amd64.deb
EOF
echo "BASE_NM=ghcr.io/${{ inputs.org }}/${{ inputs.name }}" >> $GITHUB_ENV
echo "FULL_NM=ghcr.io/${{ inputs.org }}/${{ inputs.name }}-full" >> $GITHUB_ENV
- if: ${{ inputs.daily == 'false' }}
shell: bash
Expand All @@ -47,9 +40,38 @@ runs:
shell: bash
run: echo "DAILY_TAG=-t ${{ env.BASE_NM }}:daily" >> $GITHUB_ENV

- name: Push image
- name: Create Base DockerFile
shell: bash
run: |
cat << 'EOF' >> Dockerfile
FROM ubuntu:22.04
COPY ["${{ inputs.source }}", "quarto-linux-amd64.deb"]
RUN dpkg -i quarto-linux-amd64.deb && rm quarto-linux-amd64.deb
EOF
- name: Push Base Image
shell: bash
run: |
echo ${{ inputs.token }} | docker login https://ghcr.io -u ${{ inputs.username }} --password-stdin
docker build -t ${{ env.BASE_NM }}:${{ inputs.version }} ${{ env.LATEST_TAG }} ${{ env.DAILY_TAG }} .
docker push ${{ env.BASE_NM }} --all-tags
- name: Create Full DockerFile
shell: bash
run: |
rm -rf Dockerfile
cat << 'EOF' >> Dockerfile
FROM rstudio/r-base:4.3-focal
ENV DEBIAN_FRONTEND=noninteractive
COPY ["${{ inputs.source }}", "quarto-linux-amd64.deb"]
RUN dpkg -i quarto-linux-amd64.deb && rm quarto-linux-amd64.deb
RUN quarto install tinytex --no-prompt
EOF
- name: Push Full Image
shell: bash
run: |
echo ${{ inputs.token }} | docker login https://ghcr.io -u ${{ inputs.username }} --password-stdin
docker build -t ${{ env.FULL_NM }}:${{ inputs.version }} ${{ env.LATEST_TAG }} ${{ env.DAILY_TAG }} .
docker push ${{ env.FULL_NM }} --all-tags
9 changes: 7 additions & 2 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ jobs:
curl -L https://anaconda.org/conda-forge/deno/${DENO:1}/download/linux-64/deno-${DENO:1}-he8a937b_0.conda --output deno.conda
unzip deno.conda
tar --use-compress-program=unzstd -xvf pkg-deno-${DENO:1}-he8a937b_0.tar.zst
cp bin/deno package/pkg-working/bin/tools/deno-x86_64-unknown-linux-gnu/deno
cp bin/deno package/pkg-working/bin/tools/x86_64/deno
- name: Make Tarball
run: |
Expand Down Expand Up @@ -432,6 +432,11 @@ jobs:
steps:
- name: Download Artifacts
uses: actions/download-artifact@v3

- name: Rename news
run: |
ls -la ./News
mv ./News/changelog-${{needs.configure.outputs.version_base}}.md ./News/changelog.md
- name: Generate Checksums
id: generate_checksum
Expand Down Expand Up @@ -499,7 +504,7 @@ jobs:
./Windows Zip/quarto-${{needs.configure.outputs.version}}-win.zip
./Mac Installer/quarto-${{needs.configure.outputs.version}}-macos.pkg
./Mac Zip/quarto-${{needs.configure.outputs.version}}-macos.tar.gz
./News/changelog-${{needs.configure.outputs.version_base}}.md
./News/changelog.md
quarto-${{needs.configure.outputs.version}}-checksums.txt
docker-push:
Expand Down
56 changes: 53 additions & 3 deletions .github/workflows/test-smokes-parallel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,61 @@
name: Parallel Smokes Tests
on:
workflow_dispatch:
inputs:
nBuckets:
description: "Number of buckets to split tests into"
required: true
default: 10
type: number
pull_request:
branches: [main]
push:
# only trigger on branches, not on tags
branches: [main]

jobs:
do-nothing:
jobs-matrix:
runs-on: ubuntu-latest
outputs:
BUCKETS: ${{ steps.tests-buckets.outputs.BUCKETS }}
steps:
- name: Placeholder
- name: Checkout Repo
uses: actions/checkout@v3

- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2
with:
version: pre-release

- name: Create Job for tests
id: tests-buckets
run: |
echo "BUCKETS=$(./run-parallel-tests.sh -n=${{ inputs.nBuckets || 20 }} --json-for-ci --timing-file=timing-for-ci.txt | jq -rc 'def lpad(n): tostring | if (n > length) then ((n - length) * "0") + . else . end; to_entries | map(.key |= tostring)| map({ num: .key| tonumber | (. + 1) | lpad(2), files: .value | tojson }) | {buckets: .}')" >> "$GITHUB_OUTPUT"
working-directory: tests
- name: Read buckets
run: |
echo ${{ steps.tests-buckets.outputs.BUCKETS }}
check-matrix:
runs-on: ubuntu-latest
needs: jobs-matrix
steps:
- name: Install json2yaml
run: |
sudo npm install -g json2yaml
- name: Check matrix definition
run: |
echo "This is a dummy workflow to be able to run the real one leaving on a branch for now."
matrix='${{ needs.jobs-matrix.outputs.BUCKETS }}'
echo $matrix
echo $matrix | jq .
echo $matrix | json2yaml
run-smoke-tests:
needs: jobs-matrix
name: Running Tests buckets ${{ matrix.buckets.num }}
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.jobs-matrix.outputs.BUCKETS) }}
uses: ./.github/workflows/test-smokes.yml
with:
buckets: ${{ matrix.buckets.files }}
154 changes: 116 additions & 38 deletions .github/workflows/test-smokes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,51 @@
# A failure indicates some signficant portion of functionality is likely to be broken.
name: Smoke Tests
on:
workflow_call:
inputs:
buckets:
description: "JSON string for buckets of tests to run in loop. Array of grouped tests."
required: true
type: string
time-test:
description: "Should we run tests to produce test file"
required: false
type: boolean
default: false
workflow_dispatch:
pull_request:
branches: [main]
push:
# only trigger on branches, not on tags
branches: [main]
inputs:
buckets:
description: "JSON string for buckets of tests to run in loop. Array of grouped tests."
required: false
type: string
default: ""
time-test:
description: "Should we run tests to produce test file"
required: false
type: boolean
default: false
schedule:
- cron: "0 6 * * *"

jobs:
run-smokes:
name: Run smoke (${{ matrix.os }})${{ matrix.time-test && ' with timed file' || ''}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
time-test:
- ${{ inputs.time-test }}
exclude:
# only run timed tests on Linux
- os: windows-latest
time-test: true
runs-on: ${{ matrix.os }}

env:
QUARTO_TESTS_FORCE_NO_PIPENV: true
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
# checkout full tree
fetch-depth: 0

- name: Fix temp dir to use runner one (windows)
if: runner.os == 'Windows'
Expand Down Expand Up @@ -54,7 +76,7 @@ jobs:
if: ${{ runner.os != 'Windows' || github.event_name == 'schedule' }}
run: npx playwright install --with-deps
working-directory: ./tests/integration/playwright

- name: Install MECA validator
if: ${{ runner.os != 'Windows' }}
run: npm install -g meca
Expand Down Expand Up @@ -90,8 +112,9 @@ jobs:
if (!requireNamespace('renv', quietly = TRUE)) install.packages('renv')
renv::restore()
# Install dev versions for our testing
renv::install("yihui/knitr")
renv::install("rstudio/rmarkdown")
# Use r-universe to avoid github api calls
try(renv::install('knitr', repos = c('https://yihui.r-universe.dev')))
try(renv::install('rmarkdown', repos = c('https://rstudio.r-universe.dev')))
shell: Rscript {0}
env:
RENV_CONFIG_REPOS_OVERRIDE: https://packagemanager.rstudio.com/cran/latest
Expand Down Expand Up @@ -135,40 +158,95 @@ jobs:
run: |
julia --color=yes --project=. -e "import Pkg; Pkg.instantiate(); Pkg.build(\"IJulia\"); Pkg.precompile()"
- name: Smoke Test Commits
if: github.event.before != ''
- name: Setup timing file for timed test
if: ${{ matrix.time-test == true }}
run: |
echo "QUARTO_TEST_TIMING=timing-for-ci.txt" >> "$GITHUB_ENV"
- name: Run all Smoke Tests Windows
if: ${{ runner.os == 'Windows' && format('{0}', inputs.buckets) == '' && matrix.time-test == false }}
env:
# Useful as TinyTeX latest release is checked in run-test.sh
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git checkout ${{ github.sha}}
pushd tests
case $RUNNER_OS in
"Windows")
pwsh -F ./run-tests.ps1
;;
*)
./run-tests.sh
;;
esac
popd
run: ./run-tests.ps1
working-directory: tests
shell: pwsh

- name: Run all Smoke Tests Linux
if: ${{ runner.os != 'Windows' && format('{0}', inputs.buckets) == '' }}
env:
# Useful as TinyTeX latest release is checked in run-test.sh
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./run-tests.sh
working-directory: tests
shell: bash

- name: Smoke Test Head
- name: Run Smoke Tests as a bucket on Linux
if: ${{ runner.os != 'Windows' && format('{0}', inputs.buckets) != '' }}
env:
# Useful as TinyTeX latest release is checked in run-test.sh
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: github.event.before == ''
run: |
case $RUNNER_OS in
"Windows")
../package/dist/bin/quarto.cmd render docs/test.qmd --to pdf
pwsh -F ./run-tests.ps1
;;
*)
quarto render docs/test.qmd --to pdf
./run-tests.sh
;;
esac
haserror=0
readarray -t my_array < <(echo '${{ inputs.buckets }}' | jq -rc '.[]')
for file in "${my_array[@]}"; do
echo ">>> ./run-tests.sh ${file}"
./run-tests.sh $file
status=$?
[ $status -eq 0 ] && echo ">>> No error in this test file" || haserror=1
done
[ $haserror -eq 0 ] && echo ">>> All tests passed" || exit 1
working-directory: tests
shell: bash

- name: Run Smoke Tests as a bucket on Windows
if: ${{ runner.os == 'Windows' && format('{0}', inputs.buckets) != '' }}
env:
# Useful as TinyTeX latest release is checked in run-test.sh
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$haserror=$false
foreach ($file in ('${{ inputs.buckets }}' | ConvertFrom-Json)) {
Write-Host ">>> ./run-tests.ps1 ${file}"
./run-tests.ps1 $file
$status=$LASTEXITCODE
if ($status -eq 1) {
Write-Host ">>> Error found in test file"
$haserror=$true
} else {
Write-Host ">>> No error in this test file"
}
}
if ($haserror) {
Exit 1
} else {
Write-Host ">>> All tests have passed"
}
working-directory: tests
shell: pwsh

- name: Create Pull Request for new tests timing
if: matrix.time-test
id: cpr
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
add-paths: tests/timing-for-ci.txt
commit-message: |
timing for new tests [auto PR]
branch: updates/timing-for-ci
delete-branch: true
assignees: cderv
reviewers: cderv
title: |
[CI] Update timing file
body: |
This PR was created automatically with new timing test file for our parallel smoke tests.
Please review and merge to trigger a new build of the website.
- name: Check auto PR outputs
if: steps.cpr.outcome == 'success'
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
echo "Pull Request Action Performed - ${{ steps.cpr.outputs.pull-request-operation }}"
16 changes: 16 additions & 0 deletions .github/workflows/update-test-timing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Upate the timing test file required for parallel test
on:
workflow_dispatch:
schedule:
# run weekly on Monday
- cron: "13 3 * * 1"

name: Update timing test file

jobs:
run-timed-tests:
name: Running Tests to produce timed file
uses: ./.github/workflows/test-smokes.yml
with:
buckets: ""
time-test: true
12 changes: 6 additions & 6 deletions configuration
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@
# deno_dom should match release at https://github.com/b-fuze/deno-dom/releases

# Binary dependencies
export DENO=v1.33.2
export DENO=v1.33.4
export DENO_DOM=v0.1.35-alpha-artifacts
export PANDOC=3.1.5
export PANDOC=3.1.2
export DARTSASS=1.55.0
export ESBUILD=0.15.6
export TYPST=0.6.0
export ESBUILD=0.18.15
export TYPST=0.7.0

# Bootstrap dependencies from bslib
# (use commit hash from bslib repo)
export BOOTSTRAP=8dc31b40bd9b387c4a3c36ac1f63bb853037cba6
export BOOTSTRAP=ff3e498179a066043ceb8f2cb3188f10d0d6ebc4
export BOOTSTRAP_FONT=1.10.5
export BOOTSWATCH=5.2.3
export BOOTSWATCH=5.3.1

# javascript HTML dependencies
export ANCHOR_JS=5.0.0
Expand Down
Loading

0 comments on commit ff53e41

Please sign in to comment.