Skip to content

Commit

Permalink
DRAFT: workflow setup python
Browse files Browse the repository at this point in the history
  • Loading branch information
4e6 committed May 17, 2024
1 parent 1b95e04 commit 8a16bf9
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 21 deletions.
40 changes: 30 additions & 10 deletions .github/workflows/engine-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@ jobs:
run: ./run git-clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Python
uses: actions/setup-python@v5
- name: Setup Node.js
uses: actions/setup-node@v4
- name: Run npm install
run: npm --workspace=enso-gui2 install
run: npm install
- run: ./run backend ci-check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -92,10 +94,12 @@ jobs:
run: ./run git-clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Python
uses: actions/setup-python@v5
- name: Setup Node.js
uses: actions/setup-node@v4
- name: Run npm install
run: npm --workspace=enso-gui2 install
run: npm install
- run: ./run backend ci-check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -140,10 +144,12 @@ jobs:
run: ./run git-clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Python
uses: actions/setup-python@v5
- name: Setup Node.js
uses: actions/setup-node@v4
- name: Run npm install
run: npm --workspace=enso-gui2 install
run: npm install
- run: ./run backend ci-check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -189,10 +195,12 @@ jobs:
run: ./run git-clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Python
uses: actions/setup-python@v5
- name: Setup Node.js
uses: actions/setup-node@v4
- name: Run npm install
run: npm --workspace=enso-gui2 install
run: npm install
- run: ./run backend ci-check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -238,10 +246,12 @@ jobs:
run: ./run git-clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Python
uses: actions/setup-python@v5
- name: Setup Node.js
uses: actions/setup-node@v4
- name: Run npm install
run: npm --workspace=enso-gui2 install
run: npm install
- run: ./run backend ci-check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -287,10 +297,12 @@ jobs:
run: ./run git-clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Python
uses: actions/setup-python@v5
- name: Setup Node.js
uses: actions/setup-node@v4
- name: Run npm install
run: npm --workspace=enso-gui2 install
run: npm install
- run: ./run backend test jvm
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -348,10 +360,12 @@ jobs:
run: ./run git-clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Python
uses: actions/setup-python@v5
- name: Setup Node.js
uses: actions/setup-node@v4
- name: Run npm install
run: npm --workspace=enso-gui2 install
run: npm install
- run: ./run backend test jvm
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -407,10 +421,12 @@ jobs:
run: ./run git-clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Python
uses: actions/setup-python@v5
- name: Setup Node.js
uses: actions/setup-node@v4
- name: Run npm install
run: npm --workspace=enso-gui2 install
run: npm install
- run: ./run backend test jvm
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -467,10 +483,12 @@ jobs:
run: ./run git-clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Python
uses: actions/setup-python@v5
- name: Setup Node.js
uses: actions/setup-node@v4
- name: Run npm install
run: npm --workspace=enso-gui2 install
run: npm install
- run: ./run backend test jvm
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -527,10 +545,12 @@ jobs:
run: ./run git-clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Python
uses: actions/setup-python@v5
- name: Setup Node.js
uses: actions/setup-node@v4
- name: Run npm install
run: npm --workspace=enso-gui2 install
run: npm install
- run: ./run backend test jvm
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
24 changes: 18 additions & 6 deletions .github/workflows/scala-new.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,12 @@ jobs:
run: ./run git-clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Python
uses: actions/setup-python@v5
- name: Setup Node.js
uses: actions/setup-node@v4
- name: Run npm install
run: npm --workspace=enso-gui2 install
run: npm install
- run: ./run backend ci-check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -104,10 +106,12 @@ jobs:
run: ./run git-clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Python
uses: actions/setup-python@v5
- name: Setup Node.js
uses: actions/setup-node@v4
- name: Run npm install
run: npm --workspace=enso-gui2 install
run: npm install
- run: ./run backend ci-check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -153,10 +157,12 @@ jobs:
run: ./run git-clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Python
uses: actions/setup-python@v5
- name: Setup Node.js
uses: actions/setup-node@v4
- name: Run npm install
run: npm --workspace=enso-gui2 install
run: npm install
- run: ./run backend ci-check
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -202,10 +208,12 @@ jobs:
run: ./run git-clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Python
uses: actions/setup-python@v5
- name: Setup Node.js
uses: actions/setup-node@v4
- name: Run npm install
run: npm --workspace=enso-gui2 install
run: npm install
- run: ./run backend test jvm
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -261,10 +269,12 @@ jobs:
run: ./run git-clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Python
uses: actions/setup-python@v5
- name: Setup Node.js
uses: actions/setup-node@v4
- name: Run npm install
run: npm --workspace=enso-gui2 install
run: npm install
- run: ./run backend test jvm
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -321,10 +331,12 @@ jobs:
run: ./run git-clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Python
uses: actions/setup-python@v5
- name: Setup Node.js
uses: actions/setup-node@v4
- name: Run npm install
run: npm --workspace=enso-gui2 install
run: npm install
- run: ./run backend test jvm
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 5 additions & 1 deletion build/build/src/ci_gen/job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use heck::ToKebabCase;
use ide_ci::actions::workflow::definition::cancel_workflow_action;
use ide_ci::actions::workflow::definition::npm_install_step;
use ide_ci::actions::workflow::definition::setup_node_step;
use ide_ci::actions::workflow::definition::setup_python_step;
use ide_ci::actions::workflow::definition::Access;
use ide_ci::actions::workflow::definition::Job;
use ide_ci::actions::workflow::definition::JobArchetype;
Expand Down Expand Up @@ -196,6 +197,7 @@ impl JobArchetype for JvmTests {
let mut job = RunStepsBuilder::new("backend test jvm")
.customize(move |step| {
vec![
setup_python_step(),
setup_node_step(),
npm_install_step(),
step,
Expand Down Expand Up @@ -438,7 +440,9 @@ impl JobArchetype for CiCheckBackend {
fn job(&self, target: Target) -> Job {
let job_name = format!("Engine ({})", self.graal_edition);
let mut job = RunStepsBuilder::new("backend ci-check")
.customize(move |step| vec![setup_node_step(), npm_install_step(), step])
.customize(move |step| {
vec![setup_python_step(), setup_node_step(), npm_install_step(), step]
})
.build_job(job_name, target);
match self.graal_edition {
graalvm::Edition::Community => job.env(env::GRAAL_EDITION, graalvm::Edition::Community),
Expand Down
13 changes: 9 additions & 4 deletions build/ci_utils/src/actions/workflow/definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,20 @@ pub fn setup_node_step() -> Step {
}
}

/// Step that installs npm dependencies with caching.
pub fn npm_install_step() -> Step {
/// Step that sets up a specific version of Python.
pub fn setup_python_step() -> Step {
Step {
name: Some("Run npm install".into()),
run: Some("npm --workspace=enso-gui2 install".into()),
name: Some("Setup Python".into()),
uses: Some("actions/setup-python@v5".into()),
..default()
}
}

/// Step that installs npm dependencies with caching.
pub fn npm_install_step() -> Step {
Step { name: Some("Run npm install".into()), run: Some("npm install".into()), ..default() }
}

/// Step that executes a given [GitHub Script](https://github.com/actions/github-script).
pub fn github_script_step(name: impl Into<String>, script: impl Into<String>) -> Step {
Step {
Expand Down

0 comments on commit 8a16bf9

Please sign in to comment.