From c9800b062512b28fd2a15f7299e49bdb7bbff9a3 Mon Sep 17 00:00:00 2001 From: JenChieh Date: Mon, 12 Aug 2024 19:52:12 -0700 Subject: [PATCH] ci: Add downstream test for Eask --- .elpaignore | 1 + .github/workflows/test-eask.yml | 80 +++++++++++++++++++ .gitignore | 3 + tests/fixtures/SampleElispProject/.gitignore | 5 ++ tests/fixtures/SampleElispProject/Eask | 14 ++++ .../SampleElispProject/SampleElispProject.el | 37 +++++++++ .../SampleElispProject/test/buttercup-test.el | 5 ++ 7 files changed, 145 insertions(+) create mode 100644 .github/workflows/test-eask.yml create mode 100644 tests/fixtures/SampleElispProject/.gitignore create mode 100644 tests/fixtures/SampleElispProject/Eask create mode 100644 tests/fixtures/SampleElispProject/SampleElispProject.el create mode 100644 tests/fixtures/SampleElispProject/test/buttercup-test.el diff --git a/.elpaignore b/.elpaignore index c7b6d94..5e37ce2 100644 --- a/.elpaignore +++ b/.elpaignore @@ -1,4 +1,5 @@ .bumpversion.cfg +.eask .elpaignore .github Makefile diff --git a/.github/workflows/test-eask.yml b/.github/workflows/test-eask.yml new file mode 100644 index 0000000..9c80315 --- /dev/null +++ b/.github/workflows/test-eask.yml @@ -0,0 +1,80 @@ +name: Test downstream Eask + +permissions: + actions: read + checks: read + contents: read + deployments: none + id-token: none + issues: read + discussions: none + packages: none + pages: none + pull-requests: read + repository-projects: read + security-events: read + statuses: read + +on: + pull_request: + push: + branches: + - 'master' + - '*' + paths-ignore: + - 'bin/*' + - 'docs/images/*' + - 'docs/running-tests.md' + - 'scripts' + +jobs: + build: + name: Build and test + runs-on: ${{ matrix.os }} + continue-on-error: ${{ matrix.experimental }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + emacs-version: + - 26.3 + - 27.2 + - 28.2 + - 29.4 + experimental: [false] + include: + - os: ubuntu-latest + emacs-version: snapshot + experimental: true + - os: macos-latest + emacs-version: snapshot + experimental: true + # TODO: There is an upstream error on windows, ignore it for now. + #- os: windows-latest + # emacs-version: snapshot + # experimental: true + exclude: + - os: macos-latest + emacs-version: 26.3 + - os: macos-latest + emacs-version: 27.2 + + steps: + - uses: jcs090218/setup-emacs@master + with: + version: ${{ matrix.emacs-version }} + + - uses: emacs-eask/setup-eask@master + with: + version: 'snapshot' + + - uses: actions/checkout@v4 + + - name: Generate Eask-file to link + run: eask init --from source buttercup.el + + - name: Test downstream Eask + working-directory: ./tests/fixtures/SampleElispProject/ + run: | + eask link add buttercup ../../../ + eask test buttercup diff --git a/.gitignore b/.gitignore index 9c10b91..9b3b1d2 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,6 @@ # ELPA-generated files /buttercup-autoloads.el /buttercup-pkg.el + +# Eask generated +/.eask diff --git a/tests/fixtures/SampleElispProject/.gitignore b/tests/fixtures/SampleElispProject/.gitignore new file mode 100644 index 0000000..f0c2bdf --- /dev/null +++ b/tests/fixtures/SampleElispProject/.gitignore @@ -0,0 +1,5 @@ +*.elc +/dist + +# Eask generated +/.eask diff --git a/tests/fixtures/SampleElispProject/Eask b/tests/fixtures/SampleElispProject/Eask new file mode 100644 index 0000000..aa878cd --- /dev/null +++ b/tests/fixtures/SampleElispProject/Eask @@ -0,0 +1,14 @@ +(package "SampleElispProject" + "0.0.1" + "Sample elis project") + +(website-url "https://github.com/jorgenschaefer/emacs-buttercup") +(keywords "test") + +(package-file "SampleElispProject.el") + +(script "test" "echo \"Error: no test specified\" && exit 1") + +(source 'gnu) + +(depends-on "emacs" "26.3") diff --git a/tests/fixtures/SampleElispProject/SampleElispProject.el b/tests/fixtures/SampleElispProject/SampleElispProject.el new file mode 100644 index 0000000..edd1d54 --- /dev/null +++ b/tests/fixtures/SampleElispProject/SampleElispProject.el @@ -0,0 +1,37 @@ +;;; SampleElispProject.el --- Sample elis project -*- lexical-binding: t; -*- + +;; Copyright (C) 2024 Shen, Jen-Chieh + +;; Author: Shen, Jen-Chieh +;; Maintainer: Shen, Jen-Chieh +;; URL: https://github.com/jorgenschaefer/emacs-buttercup +;; Version: 0.0.1 +;; Package-Requires: ((emacs "26.1")) +;; Keywords: test + +;; This file is not part of GNU Emacs. + +;; This program 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 3 of the License, or +;; (at your option) any later version. + +;; This program 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 this program. If not, see . + +;;; Commentary: +;; +;; +;; + +;;; Code: + + + +(provide 'SampleElispProject) +;;; SampleElispProject.el ends here diff --git a/tests/fixtures/SampleElispProject/test/buttercup-test.el b/tests/fixtures/SampleElispProject/test/buttercup-test.el new file mode 100644 index 0000000..7b87546 --- /dev/null +++ b/tests/fixtures/SampleElispProject/test/buttercup-test.el @@ -0,0 +1,5 @@ +;;; lexical-binding is required -*- lexical-binding: t; -*- + +(describe "A suite" + (it "contains a spec with an expectation" + (expect t :to-be t)))