From a345aba56706072d60e4cf2542de4c985acbefb2 Mon Sep 17 00:00:00 2001 From: Jostein Solaas Date: Tue, 10 Dec 2024 20:38:19 +0100 Subject: [PATCH] chore: pin ubuntu runner images # Conflicts: # .github/workflows/docs-ci.yml # .github/workflows/docs-publish.yml --- .github/workflows/create-jira-release.yml | 2 +- .github/workflows/docs-ci.yml | 82 ++++++++++----------- .github/workflows/docs-publish.yml | 90 +++++++++++------------ .github/workflows/examples-ci.yml | 4 +- .github/workflows/lib-ci.yml | 4 +- .github/workflows/on-push-main-branch.yml | 14 ++-- .github/workflows/pre-ci.yml | 2 +- .github/workflows/publish.yml | 2 +- .github/workflows/release-please.yml | 8 +- 9 files changed, 104 insertions(+), 104 deletions(-) diff --git a/.github/workflows/create-jira-release.yml b/.github/workflows/create-jira-release.yml index 1a1c0bc4d7..8049c62ccc 100644 --- a/.github/workflows/create-jira-release.yml +++ b/.github/workflows/create-jira-release.yml @@ -17,7 +17,7 @@ on: jobs: create-jira-release: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 with: diff --git a/.github/workflows/docs-ci.yml b/.github/workflows/docs-ci.yml index 294f87badd..48c80bade4 100644 --- a/.github/workflows/docs-ci.yml +++ b/.github/workflows/docs-ci.yml @@ -8,46 +8,46 @@ on: jobs: publish-docs: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install Poetry - run: pipx install poetry - - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: "3.11" - cache: 'poetry' - - - name: Check pyproject.toml validity - run: poetry check --no-interaction - - - name: Install deps - run: poetry install --no-interaction - - - name: Generate CLI reference - run: | - cd src - poetry run python generate_docs.py > ../docs/docs/about/getting_started/cli/cli_reference.md - - - name: Generate JSON Schema - run: | - cd src - poetry run python generate_json_schema.py > ../docs/docs/about/getting_started/yaml/ecalc_json_schema.json - - - name: Setup node - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: npm - cache-dependency-path: docs/package-lock.json - - - name: Install dependencies and test by building website - run: | - cd docs - npm ci --ignore-scripts - npm run build + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install Poetry + run: pipx install poetry + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + cache: 'poetry' + + - name: Check pyproject.toml validity + run: poetry check --no-interaction + + - name: Install deps + run: poetry install --no-interaction + + - name: Generate CLI reference + run: | + cd src + poetry run python generate_docs.py > ../docs/docs/about/getting_started/cli/cli_reference.md + + - name: Generate JSON Schema + run: | + cd src + poetry run python generate_json_schema.py > ../docs/docs/about/getting_started/yaml/ecalc_json_schema.json + + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + cache-dependency-path: docs/package-lock.json + + - name: Install dependencies and test by building website + run: | + cd docs + npm ci --ignore-scripts + npm run build diff --git a/.github/workflows/docs-publish.yml b/.github/workflows/docs-publish.yml index 4959672521..85d54c2bd7 100644 --- a/.github/workflows/docs-publish.yml +++ b/.github/workflows/docs-publish.yml @@ -11,62 +11,62 @@ env: jobs: publish-docs: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 environment: name: docs-prod steps: - - name: Checkout code - uses: actions/checkout@v4 + - name: Checkout code + uses: actions/checkout@v4 - - name: Install Poetry - run: pipx install poetry + - name: Install Poetry + run: pipx install poetry - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: "3.11" - cache: 'poetry' + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: "3.11" + cache: 'poetry' - - name: Check pyproject.toml validity - run: poetry check --no-interaction + - name: Check pyproject.toml validity + run: poetry check --no-interaction - - name: Install deps - run: poetry install --no-interaction + - name: Install deps + run: poetry install --no-interaction - - name: Generate CLI reference - run: | - cd src - poetry run python generate_docs.py > ../docs/docs/about/getting_started/cli/cli_reference.md + - name: Generate CLI reference + run: | + cd src + poetry run python generate_docs.py > ../docs/docs/about/getting_started/cli/cli_reference.md - - name: Generate JSON Schema - run: | - cd src - poetry run python generate_json_schema.py > ../docs/docs/about/getting_started/yaml/ecalc_json_schema.json + - name: Generate JSON Schema + run: | + cd src + poetry run python generate_json_schema.py > ../docs/docs/about/getting_started/yaml/ecalc_json_schema.json - - name: Setup node - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: npm - cache-dependency-path: docs/package-lock.json + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: npm + cache-dependency-path: docs/package-lock.json - - name: Install dependencies and build website - run: | - cd docs - npm ci --ignore-scripts - npm run build + - name: Install dependencies and build website + run: | + cd docs + npm ci --ignore-scripts + npm run build - - name: Push static files to Github Pages branch - run: | - cd docs/build - CREATED_FROM_REF=$(git rev-parse --short HEAD) - git init - git config user.name "GitHub Actions Bot" - git config user.email "<>" - git checkout -b $GITHUB_PAGES_BRANCH - git remote add $GITHUB_PAGES_BRANCH https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/equinor/ecalc - git add . - git commit -m "Built from commit '$CREATED_FROM_REF'" - git push -f --set-upstream gh-pages gh-pages + - name: Push static files to Github Pages branch + run: | + cd docs/build + CREATED_FROM_REF=$(git rev-parse --short HEAD) + git init + git config user.name "GitHub Actions Bot" + git config user.email "<>" + git checkout -b $GITHUB_PAGES_BRANCH + git remote add $GITHUB_PAGES_BRANCH https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/equinor/ecalc + git add . + git commit -m "Built from commit '$CREATED_FROM_REF'" + git push -f --set-upstream gh-pages gh-pages diff --git a/.github/workflows/examples-ci.yml b/.github/workflows/examples-ci.yml index fea3d5a1b9..c6ce90b349 100644 --- a/.github/workflows/examples-ci.yml +++ b/.github/workflows/examples-ci.yml @@ -7,7 +7,7 @@ on: jobs: run-tests: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Checkout code uses: actions/checkout@v4 @@ -28,7 +28,7 @@ jobs: run: poetry install --no-interaction --all-extras - name: Convert example Jupyter notebooks to Python code - run : poetry run jupyter nbconvert --to python examples/*.ipynb + run: poetry run jupyter nbconvert --to python examples/*.ipynb # This will not log any tests per se, but it will fail if there are any errors raised in the generated Python files. - name: Run tests diff --git a/.github/workflows/lib-ci.yml b/.github/workflows/lib-ci.yml index 4da5ad2257..b2f245987a 100644 --- a/.github/workflows/lib-ci.yml +++ b/.github/workflows/lib-ci.yml @@ -12,11 +12,11 @@ env: jobs: run-tests-with-coverage: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 strategy: fail-fast: false matrix: - python-version: ["3.11", "3.12", "3.13"] + python-version: [ "3.11", "3.12", "3.13" ] steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/on-push-main-branch.yml b/.github/workflows/on-push-main-branch.yml index 370d3f749c..434e5012a8 100644 --- a/.github/workflows/on-push-main-branch.yml +++ b/.github/workflows/on-push-main-branch.yml @@ -7,7 +7,7 @@ on: jobs: deploy-dummy: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 environment: name: libecalc-test steps: @@ -24,14 +24,14 @@ jobs: uses: ./.github/workflows/docs-publish.yml secrets: inherit -# We want/need to reserve patch bump in case we need to -# patch a release that is deployed and active. Therefore -# we bump minor here. Major bumps to versioning is currently -# reserved to manual invocation of release-please. - + # We want/need to reserve patch bump in case we need to + # patch a release that is deployed and active. Therefore + # we bump minor here. Major bumps to versioning is currently + # reserved to manual invocation of release-please. + release-please: uses: ./.github/workflows/release-please.yml with: versioning_strategy: 'always-bump-minor' secrets: inherit - needs: [lib-ci] \ No newline at end of file + needs: [ lib-ci ] \ No newline at end of file diff --git a/.github/workflows/pre-ci.yml b/.github/workflows/pre-ci.yml index e0c7063350..af2b1871ce 100644 --- a/.github/workflows/pre-ci.yml +++ b/.github/workflows/pre-ci.yml @@ -9,7 +9,7 @@ on: jobs: pre-commit: # Static analyzers, formatters and verifying pre-commit hooks has been run for both API and Web name: Build & Run Pre Commit hooks to verify code structure, quality etc. from pre-commit hooks - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 06a38170b6..f80791dfcb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,7 +9,7 @@ on: jobs: publish: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Checkout code uses: actions/checkout@v4 diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 0ce036faa8..6e16d25f94 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -29,7 +29,7 @@ env: jobs: release-please: permissions: write-all - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: google-github-actions/release-please-action@v3 id: release @@ -47,8 +47,8 @@ jobs: - name: Create vX.Y release branch (for simpler patching) - if normal release (not patching) if: ${{ steps.release.outputs.release_created && env.VERSIONING_STRATEGY != 'always-bump-patch' }} run: | - git checkout -b release/v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} ${{ steps.release.outputs.sha }} - git push -u origin release/v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} + git checkout -b release/v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} ${{ steps.release.outputs.sha }} + git push -u origin release/v${{ steps.release.outputs.major }}.${{ steps.release.outputs.minor }} outputs: release_created: ${{ steps.release.outputs.release_created }} tag_name: ${{ steps.release.outputs.tag_name }} @@ -61,7 +61,7 @@ jobs: needs: release-please uses: equinor/ecalc/.github/workflows/publish.yml@main secrets: - pypi_token: ${{ secrets.PYPI_TOKEN }} + pypi_token: ${{ secrets.PYPI_TOKEN }} if: ${{ needs.release-please.outputs.release_created }} create-jira-release: