Skip to content

Commit

Permalink
Bumped the build script (#3489)
Browse files Browse the repository at this point in the history
* The bash entry point was renamed `run.sh` -> `run`. Thanks to that `./run` works both on Linux and Windows with PowerShell (sadly not on CMD). 
* Everyone's favorite checks for WASM size and program versions are back. These can be disabled through `--wasm-size-limit=0` and `--skip-version-check` respectively. WASM size limit is stored in `build-config.yaml`.
* Improved diagnostics for case when downloaded CI run artifact archive cannot be extracted. 
* Added GH API authentication to the build script calls on CI. This should fix the macOS build failures that were occurring from time to time. (Actually they were due to runner being GitHub-hosted, not really an OS-specific issue by itself.)
* If the GH API Personal Access Token is provided, it will be validated. Later on it is difficult to say, whether fail was caused by wrong PAT or other issue.
* Renamed `clean` to `git-clean` as per suggestion to reduce risk of user accidently deleting unstaged work. 
* Whitelisting dependabot from changelog checks, so PRs created by it are mergeable.
* Fixing issue where wasm-pack-action (third party) randomly failed to recognize the latest version of wasm-pack (macOS runners), leading to failed builds.
* Build logs can be filtered using `ENSO_BUILD_LOG` environment variable. See https://docs.rs/tracing-subscriber/0.3.11/tracing_subscriber/struct.EnvFilter.html#directives for the supported syntax.
* Improve help for ci-run source, to make clear that PAT token is required and what scope is expected there.

Also, JS parts were updated with some cleanups and fixes following the changes made when introducing the build script.
  • Loading branch information
mwu-tow authored Jun 1, 2022
1 parent 2187123 commit 6fc4947
Show file tree
Hide file tree
Showing 26 changed files with 265 additions and 38,235 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ Please include the following checklist in your PR:
- All code has been tested:
- [ ] Unit tests have been written where possible.
- [ ] If GUI codebase was changed: Enso GUI was tested when built using BOTH
`./run.sh ide dist` and `./run.sh ide watch`.
`./run ide dist` and `./run ide watch`.
159 changes: 125 additions & 34 deletions .github/workflows/gui.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
clean: false
- id: changed_files
run: "git fetch\nlist=`git diff --name-only origin/develop HEAD | tr '\\n' ' '`\necho $list\necho \"::set-output name=list::'$list'\""
- run: "if [[ ${{ contains(steps.changed_files.outputs.list,'CHANGELOG.md') || contains(github.event.head_commit.message,'[ci no changelog needed]') || contains(github.event.pull_request.body,'[ci no changelog needed]') }} == false ]]; then exit 1; fi"
- run: "if [[ ${{ contains(steps.changed_files.outputs.list,'CHANGELOG.md') || contains(github.event.head_commit.message,'[ci no changelog needed]') || contains(github.event.pull_request.body,'[ci no changelog needed]') || github.event.pull_request.user.login == 'dependabot' }} == false ]]; then exit 1; fi"
if: "github.base_ref == 'develop' || github.base_ref == 'unstable' || github.base_ref == 'stable'"
ide-ci-actions-workflow-definition-job-build-project-manager-linux:
name: Build Project Manager (linux)
Expand All @@ -41,7 +41,7 @@ jobs:
uses: jetli/[email protected]
if: "startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent')"
with:
version: latest
version: v0.10.2
- name: Setup the Artifact API environment
uses: actions/github-script@v6
with:
Expand All @@ -50,10 +50,17 @@ jobs:
uses: actions/checkout@v3
with:
clean: false
- run: "./run.sh --help"
- run: "./run --help"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
shell: bash
- run: "./run.sh project-manager"
- run: "./run project-manager"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
shell: bash
- name: List files if failed
run: ls -R
if: failure()
ide-ci-actions-workflow-definition-job-build-project-manager-macos:
name: Build Project Manager (macos)
runs-on:
Expand All @@ -69,7 +76,7 @@ jobs:
uses: jetli/[email protected]
if: "startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent')"
with:
version: latest
version: v0.10.2
- name: Setup the Artifact API environment
uses: actions/github-script@v6
with:
Expand All @@ -78,10 +85,17 @@ jobs:
uses: actions/checkout@v3
with:
clean: false
- run: "./run.sh --help"
- run: "./run --help"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
shell: bash
- run: "./run.sh project-manager"
- run: "./run project-manager"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
shell: bash
- name: List files if failed
run: ls -R
if: failure()
ide-ci-actions-workflow-definition-job-build-project-manager-windows:
name: Build Project Manager (windows)
runs-on:
Expand All @@ -99,7 +113,7 @@ jobs:
uses: jetli/[email protected]
if: "startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent')"
with:
version: latest
version: v0.10.2
- name: Setup the Artifact API environment
uses: actions/github-script@v6
with:
Expand All @@ -109,9 +123,16 @@ jobs:
with:
clean: false
- run: ".\\run.cmd --help"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
shell: cmd
- run: ".\\run.cmd project-manager"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
shell: cmd
- name: List files if failed
run: ls -R
if: failure()
ide-ci-actions-workflow-definition-job-build-wasm-linux:
name: Build GUI (WASM) (linux)
runs-on:
Expand All @@ -129,7 +150,7 @@ jobs:
uses: jetli/[email protected]
if: "startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent')"
with:
version: latest
version: v0.10.2
- name: Setup the Artifact API environment
uses: actions/github-script@v6
with:
Expand All @@ -138,10 +159,17 @@ jobs:
uses: actions/checkout@v3
with:
clean: false
- run: "./run.sh --help"
- run: "./run --help"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
shell: bash
- run: "./run.sh wasm build"
- run: "./run wasm build"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
shell: bash
- name: List files if failed
run: ls -R
if: failure()
ide-ci-actions-workflow-definition-job-build-wasm-macos:
name: Build GUI (WASM) (macos)
runs-on:
Expand All @@ -157,7 +185,7 @@ jobs:
uses: jetli/[email protected]
if: "startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent')"
with:
version: latest
version: v0.10.2
- name: Setup the Artifact API environment
uses: actions/github-script@v6
with:
Expand All @@ -166,10 +194,17 @@ jobs:
uses: actions/checkout@v3
with:
clean: false
- run: "./run.sh --help"
- run: "./run --help"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
shell: bash
- run: "./run.sh wasm build"
- run: "./run wasm build"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
shell: bash
- name: List files if failed
run: ls -R
if: failure()
ide-ci-actions-workflow-definition-job-build-wasm-windows:
name: Build GUI (WASM) (windows)
runs-on:
Expand All @@ -187,7 +222,7 @@ jobs:
uses: jetli/[email protected]
if: "startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent')"
with:
version: latest
version: v0.10.2
- name: Setup the Artifact API environment
uses: actions/github-script@v6
with:
Expand All @@ -197,9 +232,16 @@ jobs:
with:
clean: false
- run: ".\\run.cmd --help"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
shell: cmd
- run: ".\\run.cmd wasm build"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
shell: cmd
- name: List files if failed
run: ls -R
if: failure()
ide-ci-actions-workflow-definition-job-cancel-workflow-linux:
name: Cancel Previous Runs
runs-on:
Expand Down Expand Up @@ -228,7 +270,7 @@ jobs:
uses: jetli/[email protected]
if: "startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent')"
with:
version: latest
version: v0.10.2
- name: Setup the Artifact API environment
uses: actions/github-script@v6
with:
Expand All @@ -237,10 +279,17 @@ jobs:
uses: actions/checkout@v3
with:
clean: false
- run: "./run.sh --help"
- run: "./run --help"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
shell: bash
- run: "./run.sh ide integration-test --project-manager-source current-ci-run"
- run: "./run ide integration-test --project-manager-source current-ci-run"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
shell: bash
- name: List files if failed
run: ls -R
if: failure()
ide-ci-actions-workflow-definition-job-lint-linux:
name: Lint (linux)
runs-on:
Expand All @@ -258,7 +307,7 @@ jobs:
uses: jetli/[email protected]
if: "startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent')"
with:
version: latest
version: v0.10.2
- name: Setup the Artifact API environment
uses: actions/github-script@v6
with:
Expand All @@ -267,10 +316,17 @@ jobs:
uses: actions/checkout@v3
with:
clean: false
- run: "./run.sh --help"
- run: "./run --help"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
shell: bash
- run: "./run.sh lint"
- run: "./run lint"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
shell: bash
- name: List files if failed
run: ls -R
if: failure()
ide-ci-actions-workflow-definition-job-native-test-linux:
name: Native GUI tests (linux)
runs-on:
Expand All @@ -288,7 +344,7 @@ jobs:
uses: jetli/[email protected]
if: "startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent')"
with:
version: latest
version: v0.10.2
- name: Setup the Artifact API environment
uses: actions/github-script@v6
with:
Expand All @@ -297,10 +353,17 @@ jobs:
uses: actions/checkout@v3
with:
clean: false
- run: "./run.sh --help"
- run: "./run --help"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
shell: bash
- run: "./run.sh wasm test --no-wasm"
- run: "./run wasm test --no-wasm"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
shell: bash
- name: List files if failed
run: ls -R
if: failure()
ide-ci-actions-workflow-definition-job-package-ide-linux:
name: Package IDE (linux)
needs:
Expand All @@ -321,7 +384,7 @@ jobs:
uses: jetli/[email protected]
if: "startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent')"
with:
version: latest
version: v0.10.2
- name: Setup the Artifact API environment
uses: actions/github-script@v6
with:
Expand All @@ -330,10 +393,17 @@ jobs:
uses: actions/checkout@v3
with:
clean: false
- run: "./run.sh --help"
- run: "./run --help"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
shell: bash
- run: "./run.sh ide build --wasm-source current-ci-run --project-manager-source current-ci-run"
- run: "./run ide build --wasm-source current-ci-run --project-manager-source current-ci-run"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
shell: bash
- name: List files if failed
run: ls -R
if: failure()
ide-ci-actions-workflow-definition-job-package-ide-macos:
name: Package IDE (macos)
needs:
Expand All @@ -352,7 +422,7 @@ jobs:
uses: jetli/[email protected]
if: "startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent')"
with:
version: latest
version: v0.10.2
- name: Setup the Artifact API environment
uses: actions/github-script@v6
with:
Expand All @@ -361,10 +431,17 @@ jobs:
uses: actions/checkout@v3
with:
clean: false
- run: "./run.sh --help"
- run: "./run --help"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
shell: bash
- run: "./run.sh ide build --wasm-source current-ci-run --project-manager-source current-ci-run"
- run: "./run ide build --wasm-source current-ci-run --project-manager-source current-ci-run"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
shell: bash
- name: List files if failed
run: ls -R
if: failure()
ide-ci-actions-workflow-definition-job-package-ide-windows:
name: Package IDE (windows)
needs:
Expand All @@ -385,7 +462,7 @@ jobs:
uses: jetli/[email protected]
if: "startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent')"
with:
version: latest
version: v0.10.2
- name: Setup the Artifact API environment
uses: actions/github-script@v6
with:
Expand All @@ -395,9 +472,16 @@ jobs:
with:
clean: false
- run: ".\\run.cmd --help"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
shell: cmd
- run: ".\\run.cmd ide build --wasm-source current-ci-run --project-manager-source current-ci-run"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
shell: cmd
- name: List files if failed
run: ls -R
if: failure()
ide-ci-actions-workflow-definition-job-wasm-test-linux:
name: WASM GUI tests (linux)
runs-on:
Expand All @@ -415,7 +499,7 @@ jobs:
uses: jetli/[email protected]
if: "startsWith(runner.name, 'GitHub Actions') || startsWith(runner.name, 'Hosted Agent')"
with:
version: latest
version: v0.10.2
- name: Setup the Artifact API environment
uses: actions/github-script@v6
with:
Expand All @@ -424,7 +508,14 @@ jobs:
uses: actions/checkout@v3
with:
clean: false
- run: "./run.sh --help"
- run: "./run --help"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
shell: bash
- run: "./run.sh wasm test --no-native"
- run: "./run wasm test --no-native"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
shell: bash
- name: List files if failed
run: ls -R
if: failure()
1 change: 1 addition & 0 deletions .prettierrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ overrides:
- files:
- "*.[j|t]s"
- "*.mjs"
- "*.cjs"
options:
printWidth: 100
tabWidth: 4
Expand Down
Loading

0 comments on commit 6fc4947

Please sign in to comment.