From 592df879ed2acf2d2c61b2562354b07f869e4c2d Mon Sep 17 00:00:00 2001 From: riscy Date: Sun, 26 Apr 2020 00:13:19 -0700 Subject: [PATCH] add github build action, simplify travis build --- .github/workflows/test.yml | 37 +++++++++++++++++++++++++++++++++++++ .travis.yml | 10 ++-------- Makefile | 2 +- 3 files changed, 40 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..a2d248d --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,37 @@ +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [3.6] + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + - name: Install + run: | + sudo apt-get install emacs + emacs --version + python -m pip install --upgrade pip + pip install . mypy pytest black + - name: Test + run: | + black -S --check . + pytest --doctest-modules + mypy --ignore-missing-imports . + - name: Test 'shx' Pull Request # a small package with few dependencies + env: # ... which already exists on MELPA: + EXIST_OK: true + run: MELPA_PR_URL=https://github.com/melpa/melpa/pull/4749 make + - name: Test 'kanban' Recipe # notably this is a Mercurial recipe + env: # ...and we expect it to have some nags: + EXPECT_ERROR: 2 + run: RECIPE='(kanban :fetcher hg :url "https://hg.sr.ht/~arnebab/kanban.el")' make + - name: Test 'magit' Recipe # magit is a large recipe + env: # ...which may have a couple of nags: + EXPECT_ERROR: 2 + run: RECIPE='(magit :fetcher github :repo "magit/magit" :files ("lisp/magit" "lisp/magit*.el" "lisp/git-rebase.el" "Documentation/magit.texi" "Documentation/AUTHORS.md" "LICENSE" (:exclude "lisp/magit-libgit.el")))' make diff --git a/.travis.yml b/.travis.yml index edaaeae..c84d8d5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,17 +4,11 @@ python: - "3.6" env: -# If you already have a pull request open, specify as below: - - MELPA_PR_URL=https://github.com/melpa/melpa/pull/4749 + # If you already have a pull request open, specify as below: - MELPA_PR_URL=https://github.com/melpa/melpa/pull/3041 -# Or test a recipe before you even open a MELPA pull request: - - RECIPE='(magit :fetcher github :repo "magit/magit" :files ("lisp/magit" "lisp/magit*.el" "lisp/git-rebase.el" "Documentation/magit.texi" "Documentation/AUTHORS.md" "LICENSE" (:exclude "lisp/magit-libgit.el")))' + # Or test a recipe before you even open a MELPA pull request: - RECIPE='(kanban :fetcher hg :url "https://hg.sr.ht/~arnebab/kanban.el")' install: - pip install . - - pip install mypy - - pytest --doctest-modules - - mypy --ignore-missing-imports . - script: - EXPECT_ERROR=2 make diff --git a/Makefile b/Makefile index 0898e20..af282b8 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ run: .PHONY: test test: image - @docker run -it --rm --network none ${IMAGE_NAME} + @docker run --rm --network none ${IMAGE_NAME} .PHONY: term term: image