-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deploying to gh-pages from @ 01507ae 🚀
- Loading branch information
0 parents
commit 1a5d910
Showing
298 changed files
with
511,236 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Update niv dependencies (weekly) | ||
on: | ||
# Manual override, one can start the workflow by running: | ||
# curl -H "Accept: application/vnd.github.everest-preview+json" \ | ||
# -H "Authorization: token <your-token-here>" \ | ||
# --request POST \ | ||
# --data '{"event_type": "niv-updater-nudge", "client_payload": {}}' \ | ||
# https://api.github.com/repos/dfinity-lab/motoko/dispatches | ||
# https://help.github.com/en/actions/reference/events-that-trigger-workflows#external-events-repository_dispatch | ||
repository_dispatch: | ||
types: niv-updater-nudge | ||
schedule: | ||
# * is a special character in YAML so you have to quote this string | ||
# Run every monday | ||
- cron: '0 0 * * 1' | ||
jobs: | ||
niv-updater: | ||
name: 'Check for updates' | ||
timeout-minutes: 2 # if this takes more than 2 minutes then something's wrong | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: niv-updater-action | ||
uses: knl/niv-updater-action@v10 | ||
with: | ||
# might be too noisy | ||
whitelist: 'ic-ref,musl-wasi' | ||
labels: | | ||
automerge-squash | ||
keep_updating: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.NIV_UPDATER_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# these dependencies are bumped weekly. But to not add churn | ||
# to master (e.g. downloading changed stuff in nix-shell), | ||
# CI/Mergify is instructed to simply close them as soon as CI is green. | ||
# | ||
# This means that we get an open PR only if something breaks, which is all we | ||
# want to know about. | ||
name: Update niv dependencies (trial) | ||
on: | ||
# Manual override, one can start the workflow by running: | ||
# curl -H "Accept: application/vnd.github.everest-preview+json" \ | ||
# -H "Authorization: token <your-token-here>" \ | ||
# --request POST \ | ||
# --data '{"event_type": "niv-updater-nudge", "client_payload": {}}' \ | ||
# https://api.github.com/repos/dfinity-lab/motoko/dispatches | ||
# https://help.github.com/en/actions/reference/events-that-trigger-workflows#external-events-repository_dispatch | ||
repository_dispatch: | ||
types: niv-updater-nudge | ||
schedule: | ||
# * is a special character in YAML so you have to quote this string | ||
# Run every monday | ||
- cron: '0 0 * * 0' | ||
jobs: | ||
niv-updater: | ||
name: 'Check for updates' | ||
timeout-minutes: 2 # if this takes more than 2 minutes then something's wrong | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: niv-updater-action | ||
uses: knl/niv-updater-action@v10 | ||
with: | ||
whitelist: 'nixpkgs,musl-wasi,ic' | ||
labels: | | ||
autoclose | ||
keep_updating: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.NIV_UPDATER_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Update niv dependencies (daily) | ||
on: | ||
# Manual override, one can start the workflow by running: | ||
# curl -H "Accept: application/vnd.github.everest-preview+json" \ | ||
# -H "Authorization: token <your-token-here>" \ | ||
# --request POST \ | ||
# --data '{"event_type": "niv-updater-nudge", "client_payload": {}}' \ | ||
# https://api.github.com/repos/dfinity-lab/motoko/dispatches | ||
# https://help.github.com/en/actions/reference/events-that-trigger-workflows#external-events-repository_dispatch | ||
repository_dispatch: | ||
types: niv-updater-nudge | ||
schedule: | ||
# * is a special character in YAML so you have to quote this string | ||
# Run every day | ||
- cron: '0 0 * * *' | ||
jobs: | ||
niv-updater: | ||
name: 'Check for updates' | ||
timeout-minutes: 2 # if this takes more than 2 minutes then something's wrong | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: niv-updater-action | ||
uses: knl/niv-updater-action@v10 | ||
with: | ||
# might be too noisy | ||
blacklist: 'nixpkgs,ic-ref,musl-wasi,ic' | ||
labels: | | ||
automerge-squash | ||
keep_updating: true | ||
debug_output: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.NIV_UPDATER_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
name: release | ||
|
||
# We trigger this on all tags and on the `master` branch. The job | ||
# `changelog` will fail for tags that don’t have a | ||
# changelog entry, so that seems good enough. | ||
# For `master` this check is skipped as well as uploads. | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
branches: | ||
- 'master' | ||
|
||
jobs: | ||
# first check that the changelog is in good order and extract the changelog | ||
# This will fail for non-release tags. | ||
changelog: | ||
runs-on: 'ubuntu-latest' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Get the version | ||
id: get_version | ||
run: echo ::set-output name=version::${{ github.ref_name }} | ||
|
||
- name: Extract changelog | ||
id: read_changelog | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: | | ||
export VERSION='${{ steps.get_version.outputs.version }}' | ||
perl -0777 -ne '/^# Motoko compiler changelog\n\n## (??{quotemeta($ENV{VERSION})}) \(\d\d\d\d-\d\d-\d\d\)\n\n(.*?)^##/sm or die "Changelog does not look right for this version\n" ; print $1' Changelog.md > changelog-extract.md | ||
cat changelog-extract.md | ||
# need to mangle to use with set-output, see https://github.com/svenstaro/upload-release-action/pull/49/files | ||
r="$(cat changelog-extract.md)" | ||
r="${r//'%'/'%25'}" | ||
r="${r//$'\n'/'%0A'}" | ||
r="${r//$'\r'/'%0D'}" | ||
echo "::set-output name=release_body::$r" | ||
outputs: | ||
version: ${{ steps.get_version.outputs.version }} | ||
release_body: ${{ steps.read_changelog.outputs.release_body }} | ||
|
||
# Now build the release on both linux and darwin, with the version number set | ||
build: | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-latest, macos-latest ] | ||
needs: changelog | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: cachix/install-nix-action@v16 | ||
with: | ||
extra_nix_config: | | ||
experimental-features = nix-command | ||
- uses: cachix/cachix-action@v10 | ||
if: startsWith(github.ref, 'refs/heads/') | ||
with: | ||
name: ic-hs-test | ||
# NB: No auth token, we don’t want to push new stuff here | ||
- uses: cachix/cachix-action@v10 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
name: ic-hs-test | ||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | ||
- run: cachix watch-store ic-hs-test & | ||
- name: "nix-build" | ||
# these are the dependencies listed in release-files. Sorry for the duplication | ||
run: | | ||
nix-build --max-jobs 1 --argstr releaseVersion ${{needs.changelog.outputs.version}} \ | ||
-A moc -A mo-ide -A mo-doc -A js.moc -A js.moc_interpreter | ||
# Finally do the upload. Hopefully the previous job has uploaded the | ||
# build product to the cachix cache, as we cannot build the darwin products on | ||
# linux | ||
release: | ||
if: startsWith(github.ref, 'refs/tags/') | ||
runs-on: 'ubuntu-latest' | ||
needs: [ changelog, build ] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: cachix/install-nix-action@v16 | ||
- uses: cachix/cachix-action@v10 | ||
with: | ||
name: ic-hs-test | ||
# NB: No auth token, we don’t expect to push new stuff here | ||
|
||
- run: nix-build --max-jobs 1 release-files.nix --argstr releaseVersion '${{ needs.changelog.outputs.version }}' | ||
|
||
- name: Upload Release Assets | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
tag: ${{ github.ref }} | ||
file: result/* | ||
file_glob: true | ||
body: ${{ needs.changelog.outputs.release_body }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: "build" | ||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: {} | ||
jobs: | ||
tests: | ||
strategy: | ||
matrix: | ||
os: [ ubuntu-latest, macos-latest ] | ||
fail-fast: false | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
# fetch full history so that git merge-base works | ||
fetch-depth: 0 | ||
# fetch PR commit, not predicted merge commit | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- uses: cachix/install-nix-action@v16 | ||
with: | ||
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 | ||
- uses: cachix/cachix-action@v10 | ||
with: | ||
name: ic-hs-test | ||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | ||
|
||
# until https://github.com/cachix/cachix-action/issues/86 is fixed: | ||
- run: cachix watch-store ic-hs-test & | ||
|
||
- name: "nix-build" | ||
run: nix-build-uncached --max-jobs 4 -A all-systems-go -build-flags -L | ||
|
||
- name: Calculate performance delta | ||
if: runner.os == 'Linux' && github.event_name == 'pull_request' | ||
run: | | ||
from="$(git merge-base origin/${{ github.base_ref }} HEAD)" | ||
to="${{ github.event.pull_request.head.sha }}" | ||
echo "Comparing changes from $from to $to" | ||
nix-build --max-jobs 4 perf-delta.nix -o perf-delta.txt \ | ||
--argstr ref HEAD \ | ||
--argstr from "$from" \ | ||
--argstr to "$to" | ||
- name: Read performance delta | ||
if: runner.os == 'Linux' && github.event_name == 'pull_request' | ||
id: perf | ||
uses: juliangruber/read-file-action@v1 | ||
with: | ||
path: ./perf-delta.txt | ||
|
||
- name: Find performance comment | ||
if: runner.os == 'Linux' && github.event_name == 'pull_request' | ||
uses: peter-evans/find-comment@v1 | ||
id: fc | ||
with: | ||
issue-number: ${{ github.event.pull_request.number }} | ||
comment-author: 'github-actions[bot]' | ||
body-includes: '<!-- perf comment -->' | ||
|
||
# Forks can't add comments so this job does not run on forks, see | ||
# motoko#2864. | ||
- name: Create or update performance comment | ||
if: runner.os == 'Linux' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository | ||
uses: peter-evans/create-or-update-comment@v1 | ||
with: | ||
comment-id: ${{ steps.fc.outputs.comment-id }} | ||
issue-number: ${{ github.event.pull_request.number }} | ||
body: | | ||
<!-- perf comment --> | ||
${{ steps.perf.outputs.content }} | ||
edit-mode: replace |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Update nix hashes | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- master | ||
- release | ||
tags-ignore: | ||
- '**' | ||
|
||
jobs: | ||
update-hash: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
# This is needed to be able to push and trigger CI with that push | ||
token: ${{ secrets.NIV_UPDATER_TOKEN }} | ||
- uses: cachix/install-nix-action@v16 | ||
with: | ||
nix_path: nixpkgs=channel:nixos-21.11 | ||
- uses: cachix/cachix-action@v10 | ||
with: | ||
name: ic-hs-test | ||
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' | ||
- name: Update drun cargo hash | ||
run: | | ||
cd nix | ||
nix --extra-experimental-features nix-command shell -f . nix-update -c nix-update --version=skip drun | ||
- name: Commit changes | ||
uses: EndBug/[email protected] | ||
with: | ||
author_name: Nix hash updater | ||
author_email: "<[email protected]>" | ||
message: "Updating nix hashes" | ||
# do not pull: if this branch is behind, then we might as well let | ||
# the pushing fail | ||
pull: "NO-PULL" |
Oops, something went wrong.