Skip to content

ci: Add CodeQL (#2)

ci: Add CodeQL (#2) #6

Workflow file for this run

name: build
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
jobs:
simpletests:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Pixi
uses: prefix-dev/[email protected]
with:
pixi-version: v0.25.0
environments: self
- name: Run Simple Tests
shell: pixi run -e self bash -e {0}
run: |
gridtk --help
gridtk submit --help
gridtk resubmit --help
gridtk stop --help
gridtk list --help
gridtk report --help
gridtk delete --help
tests:
runs-on: ubuntu-22.04
permissions:
# Gives the action the necessary permissions for publishing new
# comments in pull requests.
pull-requests: write
# Gives the action the necessary permissions for pushing data to the
# python-coverage-comment-action branch, and for editing existing
# comments (to avoid publishing multiple comments in the same PR)
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Pixi
uses: prefix-dev/[email protected]
with:
pixi-version: v0.25.0
environments: test
- name: Run Tests
run: pixi run test-ci
- name: Coverage comment
id: coverage_comment
uses: py-cov-action/python-coverage-comment-action@v3
with:
GITHUB_TOKEN: ${{ github.token }}
- name: Store Pull Request comment to be posted
uses: actions/upload-artifact@v4
if: steps.coverage_comment.outputs.COMMENT_FILE_WRITTEN == 'true'
with:
# If you use a different name, update COMMENT_ARTIFACT_NAME accordingly
name: python-coverage-comment-action
# If you use a different name, update COMMENT_FILENAME accordingly
path: python-coverage-comment-action.txt
doc:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Pixi
uses: prefix-dev/[email protected]
with:
pixi-version: v0.25.0
environments: doc
- name: Clean previous docs
run: pixi run doc-clean
- name: Build docs
run: pixi run doc
- name: Run doctests
run: pixi run doctest