-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #12: Create unit tests for Easysession using GitHub Actions an…
…d Cask This commit also renames easysession-set-current-session to easysession--set-current-session.
- Loading branch information
1 parent
436f860
commit 7bf893a
Showing
6 changed files
with
394 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,77 @@ | ||
# This is a basic workflow to help you get started with Actions | ||
--- | ||
# | ||
# Copyright (C) 2024 James Cherti | ||
# URL: https://github.com/jamescherti/easysession.el | ||
# | ||
# This file is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation; either version 2, or (at your option) | ||
# any later version. | ||
# | ||
# This file is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. | ||
# | ||
|
||
name: CI | ||
on: [push, pull_request] | ||
|
||
# Controls when the workflow will run | ||
on: | ||
# Triggers the workflow on push or pull request events but only for the "main" branch | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
# This workflow contains a single job called "build" | ||
build: | ||
# The type of runner that the job will run on | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
# Steps represent a sequence of tasks that will be executed as part of the job | ||
strategy: | ||
matrix: | ||
emacs-version: | ||
- 26.3 | ||
- 27.1 | ||
- 28.2 | ||
- 29.1 | ||
- 29.4 | ||
python-version: | ||
- 3.11 | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v4 | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- uses: purcell/setup-emacs@master | ||
with: | ||
version: ${{ matrix.emacs-version }} | ||
- uses: actions/cache@v2 | ||
id: cache-cask-packages | ||
with: | ||
path: .cask | ||
key: cache-cask-packages-000 | ||
- uses: actions/cache@v2 | ||
id: cache-cask-executable | ||
with: | ||
path: ~/.cask | ||
key: cache-cask-executable-000 | ||
- uses: cask/setup-cask@master | ||
if: steps.cache-cask-executable.outputs.cache-hit != 'true' | ||
with: | ||
version: snapshot | ||
- run: echo "$HOME/.cask/bin" >> $GITHUB_PATH | ||
|
||
# Runs a single command using the runners shell | ||
- name: Run a one-line script | ||
run: echo Hello, world! | ||
|
||
# Runs a set of commands using the runners shell | ||
- name: Run a multi-line script | ||
- name: Install | ||
run: | | ||
echo Add other actions to build, | ||
echo test, and deploy your project. | ||
python -m pip install --upgrade pip | ||
sudo apt-get install emacs && emacs --version | ||
git clone https://github.com/riscy/melpazoid.git ~/melpazoid | ||
pip install ~/melpazoid | ||
- name: Run melpazoid | ||
env: | ||
RECIPE: (easysession :repo "jamescherti/easysession.el" :branch "${{ github.ref_name }}" :fetcher github :files ("*.el")) | ||
EXIST_OK: false | ||
run: echo $GITHUB_REF && make -C ~/melpazoid | ||
|
||
- name: Run tests | ||
run: make test | ||
env: | ||
CASK_PATH: $HOME/.cask/bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
(source gnu) | ||
(source melpa) | ||
|
||
(package-file "easysession.el") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# | ||
# Copyright (C) 2024 James Cherti | ||
# URL: https://github.com/jamescherti/easysession.el | ||
# | ||
# This file is free software; you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation; either version 2, or (at your option) | ||
# any later version. | ||
# | ||
# This file is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. | ||
# | ||
|
||
export EMACS ?= $(shell command -v emacs 2>/dev/null) | ||
CASK_DIR := $(shell cask package-directory) | ||
|
||
$(CASK_DIR): Cask | ||
cask install | ||
@touch $(CASK_DIR) | ||
|
||
.PHONY: cask | ||
cask: $(CASK_DIR) | ||
|
||
.PHONY: compile | ||
compile: cask | ||
cask emacs -batch -L . -L test \ | ||
--eval "(setq byte-compile-error-on-warn t)" \ | ||
-f batch-byte-compile $$(cask files); \ | ||
(ret=$$? ; cask clean-elc && exit $$ret) | ||
|
||
.PHONY: test | ||
test: compile | ||
cask emacs --batch -L . -L tests -l tests/test-easysession.el -f test-easysession |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.