Verified Commit 6d61b581 authored by Zhang, Chen's avatar Zhang, Chen
Browse files

Merge branch 'qa'

parents 994db17a 2d3d4da5
Loading
Loading
Loading
Loading

.github/dependabot.yml

0 → 100644
+11 −0
Original line number Diff line number Diff line
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
updates:
  - package-ecosystem: "github-actions" # See documentation for possible values
    directory: "/" # Workflow files stored in the default location of `.github/workflows`
    schedule:
      interval: "weekly"
+11 −29
Original line number Diff line number Diff line
@@ -14,37 +14,19 @@ jobs:
      run:
        shell: bash -l {0}
    steps:
      - uses: actions/checkout@v3
      - uses: conda-incubator/setup-miniconda@v2
      - uses: actions/checkout@v4
      - uses: prefix-dev/setup-pixi@v0.8.2
        with:
          auto-update-conda: true
          mamba-version: "*"
          environment-file: environment.yml
          pixi-version: v0.50.2
          manifest: pyproject.toml
      - name: Verify docstrings
        run: pydocstyle --convention=numpy src/
        run: pixi run pydocstyle --convention=numpy src/
      - name: Install ui test requirements
        run: playwright install
      - name: Install iMars3d in editable mode
        run: pip install -e .
        run: pixi run playwright install
      - name: Tests without data repository
        uses: coactions/setup-xvfb@v1
        with:
          run: |
          python -m pytest --cov --cov-report=xml --cov-report=term -m "not datarepo"
            pixi run pytest -m 'not datarepo' --tb=short -v
      - name: Upload coverage to Codecov
        uses: codecov/codecov-action@v3

  build-wheel:
    runs-on: ubuntu-latest
    defaults:
      run:
        shell: bash -l {0}
    steps:
      - uses: actions/checkout@v3
      - uses: conda-incubator/setup-miniconda@v2
        with:
          auto-update-conda: true
          mamba-version: "*"
          environment-file: environment.yml
      - name: Build Wheel
        run: python -m build --no-isolation --wheel
      - name: Check Wheel Contents
        run: check-wheel-contents .
        uses: codecov/codecov-action@v5
+3 −3
Original line number Diff line number Diff line
@@ -20,15 +20,15 @@ jobs:

    steps:
    - name: Checkout repository
      uses: actions/checkout@v3
      uses: actions/checkout@v4

    # Initializes the CodeQL tools for scanning.
    - name: Initialize CodeQL
      uses: github/codeql-action/init@v2
      uses: github/codeql-action/init@v3
      with:
        languages: python

    - name: Perform CodeQL Analysis
      uses: github/codeql-action/analyze@v2
      uses: github/codeql-action/analyze@v3
      with:
        category: "/language:python"
+12 −47
Original line number Diff line number Diff line
@@ -23,17 +23,16 @@ jobs:
          state: "pending"
          sha: "${{ github.sha }}"
          target_url: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
      - uses: actions/checkout@v3
      - uses: actions/checkout@v4
        with:
          submodules: true
          lfs: true
      - uses: conda-incubator/setup-miniconda@v2
      - uses: prefix-dev/setup-pixi@v0.8.2
        with:
          auto-update-conda: true
          miniforge-version: latest
          environment-file: environment.yml
          pixi-version: v0.50.2
          manifest: pyproject.toml
      - name: Tests with data repository
        run: python -m pytest -m datarepo
        run: pixi run pytest -m datarepo
      - name: Update job status
        uses: Sibz/github-status-action@v1
        if: ${{ always() && github.event_name == 'workflow_dispatch' }}
@@ -52,18 +51,15 @@ jobs:
      run:
        shell: bash -l {0}
    steps:
      - uses: actions/checkout@v3
      - uses: conda-incubator/setup-miniconda@v2
      - uses: actions/checkout@v4
      - uses: prefix-dev/setup-pixi@v0.8.2
        with:
          auto-update-conda: true
          mamba-version: "*"
          environment-file: environment.yml
          pixi-version: v0.50.2
          manifest: pyproject.toml
      - name: Build Conda Package
        run: |
          # boa uses mamba to resolve dependencies
          cd conda.recipe
          VERSION=$(versioningit ../) conda mambabuild --output-folder . -c conda-forge . || exit 1
          conda verify noarch/imars3d*.tar.bz2 || exit 1
          # Build conda package using pixi
          pixi run conda-build
      - name: Deploy to Anaconda
        shell: bash -l {0}
        if: startsWith(github.ref, 'refs/tags/v')
@@ -75,35 +71,4 @@ jobs:
          CONDA_LABEL="main"
          if [ "${IS_RC}" = "true" ]; then CONDA_LABEL="rc"; fi
          echo pushing ${{ github.ref }} with label $CONDA_LABEL
          anaconda upload --label $CONDA_LABEL conda.recipe/noarch/imars3d*.tar.bz2


  trigger-deploy:
    runs-on: ubuntu-22.04
    needs: [build-conda]
    # only trigger deploys from protected branches
    if: ${{ github.ref_protected || github.ref_type == 'tag' }}
    steps:
      - name: Determine Environment
        uses: neutrons/branch-mapper@v2
        id: conda_env_name
        with:
          prefix: imars3d

      - name: Trigger deploy
        id: trigger
        uses: eic/trigger-gitlab-ci@v2
        with:
          url: https://code.ornl.gov
          token: ${{ secrets.GITLAB_TRIGGER_TOKEN }}
          project_id: 11848
          ref_name: main
          variables: |
            PLAY="update"
            CONDA_ENV="${{ steps.conda_env_name.outputs.name }}"

      - name: Annotate commit
        uses: peter-evans/commit-comment@v2
        with:
          body: |
            GitLab pipeline for ${{ steps.conda_env_name.outputs.name }} has been submitted for this commit: ${{ steps.trigger.outputs.web_url }}
          pixi run anaconda upload --label $CONDA_LABEL *.conda
+12 −0
Original line number Diff line number Diff line
@@ -277,3 +277,15 @@ $RECYCLE.BIN/
# End of https://www.toptal.com/developers/gitignore/api/python,macos,linux,windows,visualstudiocode
.vscode/settings.json
_version.py

# Pixi
.pixi/
pixi.lock
*.conda
pyproject.toml.bak

# node modules
node_modules/
package-lock.json
package.json
.claude/settings.local.json
Loading