├── .github └── workflows │ ├── add-to-project.yml │ ├── lint-commits.yml │ ├── run-tests.yml │ └── triage.yml ├── LICENSE ├── README.md └── action.yml /.github/workflows/add-to-project.yml: -------------------------------------------------------------------------------- 1 | name: Add issues to project 2 | on: 3 | workflow_call: 4 | secrets: 5 | PROJECTS_TOKEN: 6 | required: true 7 | inputs: 8 | token: 9 | description: 'Personal token for access to Github Projects (Beta)' 10 | type: string 11 | default: ${{ secrets.PROJECTS_TOKEN }} 12 | project-url: 13 | description: "URL to the target Projects (Beta) board" 14 | type: string 15 | default: https://github.com/orgs/doomemacs/projects/2 16 | jobs: 17 | add-to-project: 18 | name: Add issue to project 19 | runs-on: ubuntu-latest 20 | steps: 21 | - uses: actions/add-to-project@main 22 | with: 23 | project-url: ${{ inputs.project-url }} 24 | github-token: ${{ inputs.token }} 25 | labeled: needs-triage 26 | -------------------------------------------------------------------------------- /.github/workflows/lint-commits.yml: -------------------------------------------------------------------------------- 1 | name: Lint commits 2 | on: 3 | workflow_call: 4 | inputs: 5 | token: 6 | description: 'Token for repository access' 7 | type: string 8 | default: ${{ github.token }} 9 | 10 | jobs: 11 | lint-commits: 12 | timeout-minutes: 10 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: styfle/cancel-workflow-action@0.9.1 16 | with.access_token: ${{ inputs.token }} 17 | 18 | - name: Set up Doom Emacs CI 19 | uses: doomemacs/ci@main 20 | 21 | - name: Checkout current project 22 | uses: actions/checkout@v3.0.2 23 | with.fetch-depth: 0 24 | 25 | - name: Run commit linter 26 | env: 27 | FROM: ${{ github.event.pull_request.base.sha }} 28 | TO: ${{ github.event.pull_request.head.sha }} 29 | run: doom ci lint-commits $FROM $TO 30 | -------------------------------------------------------------------------------- /.github/workflows/run-tests.yml: -------------------------------------------------------------------------------- 1 | name: Run tests 2 | on: 3 | workflow_call: 4 | inputs: 5 | testdir: 6 | description: "TODO" 7 | type: string 8 | default: "test/" 9 | jobs: 10 | run-tests: 11 | runs-on: ${{ matrix.os }} 12 | strategy: 13 | matrix: 14 | os: [ubuntu-latest, macos-latest, windows-latest] 15 | emacs-version: [27.1, 27.2, 28.1, snapshot] 16 | steps: 17 | - uses: actions/checkout@v3.0.2 18 | 19 | - uses: doomemacs/ci@main 20 | with.emacs-version: ${{ matrix.emacs-version }} 21 | 22 | - run: doom ci run-tests ${{ inputs.testdir }} 23 | -------------------------------------------------------------------------------- /.github/workflows/triage.yml: -------------------------------------------------------------------------------- 1 | name: Preform basic triage for new issues and PRs 2 | on: 3 | workflow_call: 4 | inputs: 5 | token: 6 | description: 'Token for repository access' 7 | type: string 8 | default: ${{ github.token }} 9 | jobs: 10 | lock: 11 | timeout-minutes: 10 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/stale@v5.0.0 15 | with: 16 | repo-token: ${{ inputs.token }} 17 | stale-issue-message: > 18 | :warning: **This issue was automatically marked stale because it was 19 | inactive for 60 days.** If this issue is still valid, please reply 20 | to it or it will be closed in 7 days. 21 | stale-pr-message: >- 22 | :warning: **This pull request was automatically marked stale because 23 | it was inactive for 60 days.** If this PR is still valid, please 24 | reply to it or it will be closed in 7 days. 25 | exempt-issue-labels: 'needs-triage,help wanted' 26 | exempt-pr-labels: 'needs-triage,help wanted' 27 | stale-issue-label: stale 28 | stale-pr-label: stale 29 | exempt-all-milestones: true 30 | exempt-all-assignees: true 31 | exempt-draft-pr: true 32 | 33 | - uses: dessant/lock-threads@v2 34 | with: 35 | github-token: ${{ inputs.token }} 36 | issue-lock-inactive-days: '90' 37 | pr-lock-inactive-days: '90' 38 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2022 Henrik Lissner 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # doomemacs/ci 2 | 3 | > :warning: This action is in alpha, and will undergo drastic and sudden changes 4 | > without warning. What's more, it uses a version of Doom Emacs' CLI that isn't 5 | > publicly available yet (use the `legacy` branch instead). Use at your own 6 | > risk. 7 | 8 | A Github action that sets up a Doom Emacs environment so it can be used for 9 | CI/CD. 10 | 11 | ## Usage 12 | ```yml 13 | name: Run tests 14 | on: 15 | pull_request: 16 | push: 17 | paths-ignore: 18 | - '**.md' 19 | - '**.org' 20 | - 'docs/**' 21 | - '.dir-locals.el' 22 | - 'LICENSE' 23 | branches: 24 | - master 25 | jobs: 26 | run-tests: 27 | runs-on: ${{ matrix.os }} 28 | strategy: 29 | matrix: 30 | os: [ubuntu-latest, macos-latest, windows-latest] 31 | emacs-version: [27.1, 27.2, 28.1, snapshot] 32 | steps: 33 | - uses: actions/checkout@v3.0.2 34 | 35 | - uses: doomemacs/ci@main 36 | with: 37 | emacs-version: ${{ matrix.emacs-version }} 38 | 39 | - run: doom ci run-tests tests/ 40 | ``` 41 | 42 | ## Configuration 43 | By default, this action sets `$DOOMDIR` to `.github/`, so more in-depth CI/CD 44 | configuration can be placed in: 45 | 46 | - `.github/ci.el`: reconfigure `doom ci ...` commands here. 47 | - `.github/cli.el`: define your own cli commands here. 48 | - `.github/packages.el`: for specifying external dependencies 49 | 50 | Change `inputs.doomdir` to change the location. 51 | 52 | ## Options 53 | Every argument is optional. 54 | 55 | | Input | Description | Default | 56 | |---------------|-----------------------------------------------------------|--------------| 57 | | version | The version, branch, tag, or SHA of Doom core to install | `"master"` | 58 | | emacs-version | The version of Emacs to install (use snapshot for `HEAD`) | `"28.1"` | 59 | | emacsdir | Where to install Doom Emacs | `".emacs.d"` | 60 | | doomdir | Where to look for any private configuration | `".github"` | 61 | | sync | Whether to automatically 'doom sync' after install | `true` | 62 | 63 | ## Contributing 64 | `TODO` 65 | -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: 'Set up a Doom Emacs environment' 2 | description: 'Install a specific version of Doom Emacs (and Emacs) for use in your workflow.' 3 | author: 'Henrik Lissner' 4 | 5 | inputs: 6 | version: 7 | description: 'The version, branch, tag, or SHA of Doom core to install, e.g. "v3.0.0", or "master" for the latest development version.' 8 | type: string 9 | default: "master" 10 | emacs-version: 11 | description: 'The version of Emacs to install, e.g. "28.1", or "snapshot" for a recent development version.' 12 | type: string 13 | default: "28.1" 14 | emacsdir: 15 | description: "TODO" 16 | type: string 17 | default: ".emacs.d" 18 | doomdir: 19 | description: "TODO" 20 | type: string 21 | default: ".github" 22 | sync: 23 | description: "Whether or not to automatically run 'doom sync'" 24 | type: boolean 25 | default: true 26 | sync-options: 27 | description: "Options to pass to 'doom sync'" 28 | type: string 29 | default: "-f cli.el --no-compile" 30 | 31 | runs: 32 | using: 'composite' 33 | env: 34 | EMACSDIR: ${{ inputs.emacsdir }} 35 | DOOMDIR: ${{ inputs.doomdir }} 36 | steps: 37 | - uses: purcell/setup-emacs@master 38 | if: runner.os != 'Windows' 39 | with.version: ${{ inputs.emacs-version }} 40 | 41 | - uses: actions/setup-python@v2 42 | if: runner.os == 'Windows' 43 | with: 44 | python-version: '3.6' 45 | architecture: 'x64' 46 | - uses: jcs090218/setup-emacs-windows@master 47 | if: runner.os == 'Windows' 48 | with.version: ${{ inputs.emacs-version }} 49 | 50 | - name: Checkout Doom Emacs 51 | uses: actions/checkout@v3.0.2 52 | with: 53 | repository: doomemacs/doomemacs 54 | path: ${{ inputs.emacsdir }} 55 | ref: ${{ inputs.version }} 56 | 57 | - name: Generate DOOMHASH and add bin/doom to PATH 58 | shell: bash 59 | run: | 60 | # To later identify if this config has changed. 61 | echo "DOOMHASH=$(doom profile hash)" >> $GITHUB_ENV 62 | 63 | # Add bin/doom to $PATH with perl because it's more ubiqitous and 64 | # consistent across platforms than 'readlink -f'. 65 | perl -MCwd -le 'print Cwd::abs_path shift' ${{ inputs.emacsdir }}/bin >> $GITHUB_PATH 66 | 67 | - name: Cache packages 68 | uses: actions/cache@v3 69 | with: 70 | path: ${{ inputs.emacsdir }}/.local/straight/repos 71 | key: build-${{ env.DOOMHASH }} 72 | 73 | - name: doom sync 74 | if: inputs.sync 75 | run: doom ${{ inputs.sync-options }} sync 76 | --------------------------------------------------------------------------------