Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI: Publish reports to Github Actions #3113

Merged
merged 18 commits into from
Feb 18, 2022
29 changes: 27 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ jobs:
extra_nix_config: |
experimental-features = nix-command

- run: nix-env -iA nix-build-uncached -f nix/

# We are using the ic-hs-test cachix cache that is also used by
# dfinity/ic-hs. This is partly laziness (on need to set up a separate
# cache), but also to get the ic-ref-test binary without rebuilding
Expand All @@ -35,6 +33,8 @@ jobs:
# until https://github.com/cachix/cachix-action/issues/86 is fixed:
- run: cachix watch-store ic-hs-test &

- run: nix-env -iA nix-build-uncached -f nix/

- name: "nix-build"
run: nix-build-uncached --max-jobs 4 -A all-systems-go -build-flags -L

Expand Down Expand Up @@ -77,3 +77,28 @@ jobs:
<!-- perf comment -->
${{ steps.perf.outputs.content }}
edit-mode: replace

reports:
if: github.ref == 'refs/heads/master'
needs: tests
concurrency: ci-${{ github.ref }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: cachix/install-nix-action@v16
with:
extra_nix_config: |
experimental-features = nix-command
- uses: cachix/cachix-action@v10
with:
name: ic-hs-test
- name: Fetch report
run: nix-build -A report-site -o report-site
- name: Resolve symlinks
run: cp -rL report-site report-site-copy
- name: Push report to gitub pages
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: report-site-copy
single-commit: true
26 changes: 16 additions & 10 deletions CI.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,22 +94,28 @@ Mergify reacts to the `automerge-squash` label. Once approved and CI passes, it
merges master into the branch (using normal merge, which is important for
stashed PRs) and then squash-merges the PR.

Render and show generated base docs
-----------------------------------
Render and provide various reports
----------------------------------
**Use-case:**
To be able to see and share the effects on the generated documentation for the base library, caused by a change to `mo-doc`, without needing the reviewer to generate the documentation locally.
Various build artifacts are most useful when available directly in the browser, namely:

**Implementation (internal):**
Hydra hosts the build product of the `base-doc` CI job. This can be found via the Hydra job status page, and the there is a stable link for the latest build of `master` and of each PR.
* The motoko user guide
* The “overview slides”
* The documentation for `motoko-base`, in the version pinned by motoko
* Flamegraphs for the programs in `tests/perf`

Render and show slides
----------------------
**Use-case:**
To be able to see and share the “overview slides”, the rendered version should be hosted somewhere.
A stable link to these should exist for `master`, and an easy-to-find link for each PR.

**Implementation (internal):**
Hydra hosts the build product of the `overview-slides` CI job. This can be found via the Hydra job status page, and the there is a stable link for the latest build of `master` and of each PR.
Hydra hosts the build products of the relevant jobs, and can be found via the
Hydra job status page, and the there is a stable link for the latest build of
`master` and of each PR.

**Implementation (external):**
The latest `master` version of the file is availble at
<https://dfinity.github.io/motoko/>.
The reports are calculated in PRs (so failures would be caught), but are not
hosted anywhere.

Performance changes are known
-----------------------------
Expand Down
17 changes: 17 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -617,6 +617,22 @@ rec {
'';
};

report-site = nixpkgs.runCommandNoCC "report-site" {
buildInputs = [ nixpkgs.tree ];
} ''
mkdir -p $out
ln -s ${base-doc} $out/base-doc
ln -s ${docs} $out/docs
ln -s ${tests.profiling-graphs} $out/flamegraphs
cd $out;
# generate a simple index.html, listing the entry points
( echo docs/overview-slides.html;
echo docs/docs/language-guide/motoko.html;
echo base-doc/index.html
echo flamegraphs/index.html ) | \
tree -H . -l --fromfile -T "Motoko build reports" > index.html
'';

check-generated = nixpkgs.runCommandNoCC "check-generated" {
nativeBuildInputs = [ nixpkgs.diffutils ];
expected = import ./nix/generate.nix { pkgs = nixpkgs; };
Expand Down Expand Up @@ -673,6 +689,7 @@ rec {
base-tests
base-doc
docs
report-site
ic-ref-run
shell
check-formatting
Expand Down