Reddit - Programmer Humor - Works on my Machine
.github/workflows
name_of_workflow.yml
name: Build documentation and upload artifact
on: pull_request: branches: main push: branches: - "*" tags: - "v*" schedule: - cron: 0 9 * * 1 workflow_call: workflow_dispatch:
on: pull_request: branches: main
Triggered when
main
[development, main, "v[0-9].[0-9]+.[0-9]+"]
on: push: branches: - "*" tags: - "v*"
v
schedule: - cron: 0 9 * * 1
on: workflow_call:
jobs: build-docs: uses: ./.github/workflows/build_docs.yml deploy: needs: [build-docs, pre-commit]
Source: https://github.com/jorgensd/dolfinx_mpc/actions/runs/6932364745
on: workflow_dispatch:
env: PUBLISH_DIR: ./_build/html PYTHON_VERSION: "3.10"
${PUBLISH_DIR}
${{ env.PUBLISH_DIR }}
jobs: build: runs-on: ubuntu-22.04 steps: - name: Run echo run: echo "HELLO WORLD" - name: Multiple commands run: | echo "HI" ls
jobs: build: runs-on: ubuntu-22.04 container: ghcr.io/fenics/dolfinx/dolfinx:nightly steps: - name: Run echo run: python3 -c "import dolfinx; print(dolfinx.__version__)
Github marketplace for actions: https://github.com/marketplace?category=&query=&type=actions
jobs: clone-repo: runs-on: ubuntu-22.04 steps: - name: Checkout current repo on current branch uses: actions/checkout@v4 - name: Look at current files run: ls
jobs: clone-repo: runs-on: ubuntu-22.04 steps: - name: Setup python uses: actions/setup-python@v4 with: python-version: ${PYTHON_VERSION}
- name: Install DOLFINx uses: ./.github/actions/install-dolfinx with: dolfinx: main ufl: main ffcx: main basix: main petsc_arch: ${PETSC_ARCH}
Example from: https://github.com/jorgensd/actions
name: Use a remote action on: push: branches: ["dokken/ci"] jobs: test: runs-on: ubuntu-latest container: ghcr.io/fenics/dolfinx/dolfinx:nightly steps: - name: "Use remote action" uses: jorgensd/actions/install-dolfinx@v0.1.0
- name: Upload artifact uses: actions/upload-artifact@v3 with: path: ${{ env.PUBLISH_DIR }} if-no-files-found: error name: documentation
- name: Download docs artifact uses: actions/download-artifact@v3 with: name: documentation path: "./public"
As your research evolves from ideas into code, you would like to ensure that the code can be used by others. To ensure quality, consistency and reproducibility of your research,