Skip to content

ci: switch to GitHub Actions #228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Feb 3, 2025
Merged

ci: switch to GitHub Actions #228

merged 14 commits into from
Feb 3, 2025

Conversation

mschoettle
Copy link
Member

@mschoettle mschoettle commented Jan 30, 2025

Add GitHub Actions workflow for CI.

The importer produced the following workflow:

docs.yml
name: opalmedapps/docs
on:
  push:
  pull_request:
  workflow_dispatch:
concurrency:
  group: "${{ github.ref }}"
  cancel-in-progress: true
jobs:
  pre-commit:
    runs-on: ubuntu-latest
    container:
      image: squidfunk/mkdocs-material:9.5.49
      options: "--entrypoint "
    timeout-minutes: 60
    steps:
    - uses: actions/[email protected]
      with:
        fetch-depth: 20
        lfs: true
    - run: pip install pre-commit
    - run: SKIP="markdownlint-cli2" pre-commit run --all
  markdownlint:
    runs-on: ubuntu-latest
    container:
      image: davidanson/markdownlint-cli2-rules:v0.14.0
      options: "--entrypoint "
    timeout-minutes: 60
    steps:
    - uses: actions/[email protected]
      with:
        fetch-depth: 20
        lfs: true
    - run: markdownlint-cli2 --config .gitlab/markdownlint/.markdownlint-cli2.yaml "**/*.md"
#     # 'artifacts.codequality' was not transformed because there is no suitable equivalent in GitHub Actions
  build:
    needs:
    - pre-commit
    - markdownlint
    runs-on: ubuntu-latest
    container:
      image: squidfunk/mkdocs-material:9.5.49
      options: "--entrypoint "
    timeout-minutes: 60
    env:
      GIT_DEPTH: 0
    steps:
    - uses: actions/[email protected]
      with:
        fetch-depth: 0
        lfs: true
    - uses: actions/[email protected]
    - run: pip install -r requirements.txt
    - run: mkdocs --version
    - run: mkdocs build --strict --site-dir public
    - uses: actions/[email protected]
      if: success()
      with:
        name: "${{ github.job }}"
        retention-days: 7
        path: public
  pages:
    needs: build
    runs-on: ubuntu-latest
    container:
      image: squidfunk/mkdocs-material:9.5.49
      options: "--entrypoint "
    if: ${{ github.ref }} == $CI_DEFAULT_BRANCH
    timeout-minutes: 60
    steps:
    - uses: actions/[email protected]
      with:
        fetch-depth: 20
        lfs: true
    - uses: actions/[email protected]
    - run: mkdocs --version
    - uses: actions/[email protected]
      if: success()
      with:
        name: "${{ github.job }}"
        path: public
    - uses: JamesIves/[email protected]
      with:
        branch: gh-pages
        folder: public

I decided to split this up into two jobs: lint and build and use a workflow that I have used for a personal project with uv.

@mschoettle mschoettle self-assigned this Jan 30, 2025
needs:
- lint
steps:
- uses: actions/[email protected]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this step have a name, like the checkout step above?

Same question for one of the other steps below that doesn't have a name.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not required, it will then say "Run actions/[email protected]".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I leave it up to you then.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed names where it is obvious (when reusing an action).

@mschoettle mschoettle merged commit 7628270 into main Feb 3, 2025
2 checks passed
@mschoettle mschoettle deleted the switch-github-actions branch February 3, 2025 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants