-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c821753
commit abf73a3
Showing
5 changed files
with
116 additions
and
1 deletion.
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,33 @@ | ||
name: Generate docs | ||
|
||
on: | ||
# Run when a release is published | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
generate-docs: | ||
name: Generate docs | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pages: write | ||
id-token: write | ||
steps: | ||
- name: Check out the repository | ||
uses: actions/checkout@v3 | ||
- name: Install Roc | ||
uses: hasnep/setup-roc@main | ||
with: | ||
roc-version: nightly | ||
- name: Generate docs | ||
run: roc docs package/main.roc | ||
- name: Fix absolute paths | ||
run: | | ||
find generated-docs/ -type f -name '*.html' -exec sed -i "s/\(href\|src\)=\"\//\1=\"\/${{ github.event.repository.name }}\//g" {} + | ||
- name: Upload docs artifact | ||
uses: actions/upload-pages-artifact@v1 | ||
with: | ||
path: generated-docs | ||
- name: Deploy docs | ||
uses: actions/deploy-pages@v2 |
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 @@ | ||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
# this cancels workflows currently in progress if you start a new one | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
|
||
test-examples: | ||
runs-on: [ubuntu-20.04] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: get latest roc nightly | ||
run: | | ||
curl -fOL https://github.com/roc-lang/roc/releases/download/nightly/roc_nightly-linux_x86_64-latest.tar.gz | ||
- name: rename nightly tar | ||
run: mv $(ls | grep "roc_nightly.*tar\.gz") roc_nightly.tar.gz | ||
|
||
- name: decompress the tar | ||
run: tar -xzf roc_nightly.tar.gz | ||
|
||
- run: rm roc_nightly.tar.gz | ||
|
||
- name: simplify nightly folder name | ||
run: mv roc_nightly* roc_nightly | ||
|
||
- run: ./roc_nightly/roc version | ||
|
||
- run: sudo apt install -y expect | ||
|
||
- run: expect -v | ||
|
||
- run: ./ci/all_tests.sh |
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 |
---|---|---|
|
@@ -23,3 +23,7 @@ examples/*.wasm | |
*.png | ||
|
||
.envrc | ||
|
||
generated-docs/ | ||
|
||
format.sh |
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
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,34 @@ | ||
#!/usr/bin/env bash | ||
|
||
# https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/ | ||
set -euxo pipefail | ||
|
||
if [ -z "${ROC}" ]; then | ||
echo "ERROR: The ROC environment variable is not set. | ||
Set it to something like: | ||
/home/username/Downloads/roc_nightly-linux_x86_64-2023-10-30-cb00cfb/roc | ||
or | ||
/home/username/gitrepos/roc/target/build/release/roc" >&2 | ||
|
||
exit 1 | ||
fi | ||
|
||
EXAMPLES_DIR='./examples/' | ||
PLATFORM_DIR='./platform/' | ||
|
||
# roc check | ||
for roc_file in $EXAMPLES_DIR*.roc; do | ||
$ROC check $roc_file | ||
done | ||
|
||
for roc_file in $PLATFORM_DIR*.roc; do | ||
$ROC check $roc_file | ||
done | ||
|
||
# roc build | ||
for roc_file in $EXAMPLES_DIR*.roc; do | ||
$ROC build $roc_file --target=wasm32 --no-link | ||
done | ||
|
||
# test building docs website | ||
$ROC docs platform/main.roc |