Skip to content

Commit beaea21

Browse files
committed
Change Python project to Cask
1 parent 79be578 commit beaea21

File tree

15 files changed

+1601
-5710
lines changed

15 files changed

+1601
-5710
lines changed

.github/python.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

.github/workflows/workflow.yml

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,29 @@
11
name: Main workflow
22
on: [push]
3+
34
jobs:
4-
run:
5-
name: Run
6-
runs-on: ${{ matrix.operating-system }}
5+
test:
6+
runs-on: ubuntu-latest
77
strategy:
88
matrix:
9-
operating-system: [ubuntu-latest, windows-latest]
9+
cask_version:
10+
- '0.8.0'
11+
- '0.8.4'
12+
- 'snapshot'
1013
steps:
11-
- name: Checkout
12-
uses: actions/checkout@master
13-
14-
- name: Set Node.js 10.x
15-
uses: actions/setup-node@master
14+
- uses: actions/checkout@master
15+
- uses: actions/setup-node@master
1616
with:
17-
version: 10.x
17+
node-version: 10.x
1818

19-
- name: npm install
20-
run: npm install
19+
- uses: purcell/setup-emacs@master
20+
with:
21+
version: 26.3
2122

22-
- name: Lint
23-
run: npm run format-check
23+
- run: npm install
24+
- run: npm run format-check
25+
- run: npm test
2426

25-
- name: npm test
26-
run: npm test
27+
- uses: ./
28+
with:
29+
version: ${{ matrix.cask_version }}

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
The MIT License (MIT)
33

4-
Copyright (c) 2018 GitHub, Inc. and contributors
4+
Copyright (c) 2019 Naoya Yamashita
55

66
Permission is hereby granted, free of charge, to any person obtaining a copy
77
of this software and associated documentation files (the "Software"), to deal
@@ -19,4 +19,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1919
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2020
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2121
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22-
THE SOFTWARE.
22+
THE SOFTWARE.

README.md

Lines changed: 0 additions & 55 deletions
This file was deleted.

README.org

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
#+author: conao
2+
#+date: <2019-11-23 Sat>
3+
4+
[[https://github.com/conao3/setup-cask][https://raw.githubusercontent.com/conao3/files/master/blob/headers/png/feather.el.png]]
5+
[[https://github.com/conao3/setup-cask/blob/master/LICENSE][https://img.shields.io/github/license/conao3/setup-cask.svg?style=flat-square]]
6+
[[https://github.com/conao3/setup-cask/releases][https://img.shields.io/github/tag/conao3/setup-cask.svg?style=flat-square]]
7+
[[https://github.com/conao3/setup-cask/actions][https://github.com/conao3/setup-cask/workflows/Main%20workflow/badge.svg]]
8+
[[https://app.codacy.com/project/conao3/setup-cask/dashboard][https://img.shields.io/codacy/grade/1108333059ce4bc7a833a42a4eaf417c.svg?logo=codacy&style=flat-square]]
9+
[[https://www.patreon.com/conao3][https://img.shields.io/badge/patreon-become%20a%20patron-orange.svg?logo=patreon&style=flat-square]]
10+
[[https://twitter.com/conao_3][https://img.shields.io/badge/twitter-@conao__3-blue.svg?logo=twitter&style=flat-square]]
11+
[[https://join.slack.com/t/conao3-support/shared_invite/enQtNjUzMDMxODcyMjE1LTA4ZGRmOWYwZWE3NmE5NTkyZjk3M2JhYzU2ZmRkMzdiMDdlYTQ0ODMyM2ExOGY0OTkzMzZiMTNmZjJjY2I5NTM][https://img.shields.io/badge/chat-on_slack-blue.svg?logo=slack&style=flat-square]]
12+
13+
* Table of Contents
14+
- [[#description][Description]]
15+
- [[#usage][Usage]]
16+
- [[#information][Information]]
17+
- [[#donation][Donation]]
18+
- [[#community][Community]]
19+
- [[#contribution][Contribution]]
20+
- [[#license][License]]
21+
- [[#author][Author]]
22+
- [[#contributors][Contributors]]
23+
24+
* Description
25+
~setup-cask~ prepare Cask for your workflow.
26+
- Fetch specified Cask in your workflow ~$HOME~ (such as ~/home/runner/.cask~).
27+
- Add ~/home/runner/.cask/bin~ to your workflow ~$PATH~
28+
- Initiarize Cask
29+
30+
* Usage
31+
~Cask~ depends ~Python~ and ~Emacs~.
32+
You should setup these, respectively, before use ~setup-cask~.
33+
34+
This mechanism has a merit to be able to use specified version of ~Python~ and ~Emacs~.
35+
36+
** Basic
37+
#+begin_src yaml
38+
jobs:
39+
build:
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v1
43+
- uses: actions/[email protected]
44+
with:
45+
python-version: '3.6'
46+
architecture: 'x64'
47+
- uses: purcell/setup-emacs@master
48+
with:
49+
version: '26.3'
50+
51+
- uses: conao3/setup-cask@master
52+
with:
53+
version: 'snapshot'
54+
55+
- name: Run tests
56+
run: make test
57+
#+end_src
58+
59+
This example is testing your package in below environment.
60+
- Emacs: ~26.3~
61+
- Python: ~3.6~
62+
- Cask: ~snapshot~ (HEAD)
63+
64+
** Matrix testing
65+
#+begin_src yaml
66+
jobs:
67+
build:
68+
runs-on: ubuntu-latest
69+
strategy:
70+
matrix:
71+
emacs_version:
72+
- '26.1'
73+
- '26.2'
74+
- '26.3'
75+
- 'snapshot'
76+
cask_version:
77+
- '0.8.0'
78+
- '0.8.4'
79+
- 'snapshot'
80+
steps:
81+
- uses: actions/checkout@v1
82+
- uses: actions/[email protected]
83+
with:
84+
python-version: '3.6'
85+
architecture: 'x64'
86+
- uses: purcell/setup-emacs@master
87+
with:
88+
version: '26.3'
89+
90+
- uses: conao3/setup-cask@master
91+
with:
92+
version: 'snapshot'
93+
94+
- name: Run tests
95+
run: make test
96+
#+end_src
97+
98+
This example is testing your package in below environment.
99+
- Emacs: ~26.1~, ~26.2~, ~26.3~
100+
- Python: ~3.6~
101+
- Cask: ~0.8.0~, ~0.8.4~, ~snapshot~ (HEAD)
102+
103+
* Information
104+
** Donation
105+
I love OSS and I am dreaming of working on it as *full-time* job.
106+
107+
*With your support*, I will be able to spend more time at OSS!
108+
109+
[[https://www.patreon.com/conao3][https://c5.patreon.com/external/logo/become_a_patron_button.png]]
110+
111+
** Community
112+
All feedback and suggestions are welcome!
113+
114+
You can use github issues, but you can also use [[https://join.slack.com/t/conao3-support/shared_invite/enQtNjUzMDMxODcyMjE1LTA4ZGRmOWYwZWE3NmE5NTkyZjk3M2JhYzU2ZmRkMzdiMDdlYTQ0ODMyM2ExOGY0OTkzMzZiMTNmZjJjY2I5NTM][Slack]]
115+
if you want a more casual conversation.
116+
117+
** Contribution
118+
Feel free to send PR!
119+
120+
** License
121+
#+begin_example
122+
MIT
123+
Copyright (c) Naoya Yamashita - https://conao3.com
124+
https://github.com/conao3/setup-cask/blob/master/LICENSE
125+
#+end_example
126+
127+
** Author
128+
- Naoya Yamashita ([[https://github.com/conao3][conao3]])
129+
130+
** Contributors
131+
- Not yet... Now send PR and add your name!!

__tests__/finder.test.ts

Lines changed: 5 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,9 @@
1-
import io = require('@actions/io');
2-
import fs = require('fs');
3-
import path = require('path');
1+
// finder.test.ts
42

5-
const toolDir = path.join(
6-
__dirname,
7-
'runner',
8-
path.join(
9-
Math.random()
10-
.toString(36)
11-
.substring(7)
12-
),
13-
'tools'
14-
);
15-
const tempDir = path.join(
16-
__dirname,
17-
'runner',
18-
path.join(
19-
Math.random()
20-
.toString(36)
21-
.substring(7)
22-
),
23-
'temp'
24-
);
3+
const assert = require('assert');
254

26-
process.env['RUNNER_TOOL_CACHE'] = toolDir;
27-
process.env['RUNNER_TEMP'] = tempDir;
28-
29-
import * as finder from '../src/find-python';
30-
31-
describe('Finder tests', () => {
32-
it('Finds Python if it is installed', async () => {
33-
const pythonDir: string = path.join(toolDir, 'Python', '3.0.0', 'x64');
34-
await io.mkdirP(pythonDir);
35-
fs.writeFileSync(`${pythonDir}.complete`, 'hello');
36-
// This will throw if it doesn't find it in the cache (because no such version exists)
37-
await finder.findPythonVersion('3.x', 'x64');
38-
});
39-
40-
it('Errors if Python is not installed', async () => {
41-
// This will throw if it doesn't find it in the cache (because no such version exists)
42-
let thrown = false;
43-
try {
44-
await finder.findPythonVersion('3.300000', 'x64');
45-
} catch {
46-
thrown = true;
47-
}
48-
expect(thrown).toBeTruthy();
49-
});
50-
51-
it('Finds PyPy if it is installed', async () => {
52-
const pythonDir: string = path.join(toolDir, 'PyPy', '2.0.0', 'x64');
53-
await io.mkdirP(pythonDir);
54-
fs.writeFileSync(`${pythonDir}.complete`, 'hello');
55-
// This will throw if it doesn't find it in the cache (because no such version exists)
56-
await finder.findPythonVersion('pypy2', 'x64');
5+
describe('SyncTest', function() {
6+
it('Equality', function() {
7+
assert.equal(1 + 1, 2);
578
});
589
});

action.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
name: 'Setup Python'
2-
description: 'Set up a specific version of Python and add the command-line tools to the PATH'
3-
author: 'GitHub'
1+
name: 'Setup Cask'
2+
description: 'Install a specific Cask version for use in your workflow.'
3+
author: 'Naoya Yamashita'
44
inputs:
5-
python-version:
6-
description: 'Version range or exact version of a Python version to use, using semvers version range syntax.'
7-
default: '3.x'
8-
architecture:
9-
description: 'The target architecture (x86, x64) of the Python interpreter.'
10-
default: 'x64'
5+
version:
6+
description: 'The version of Emacs to install, e.g. "0.8.4", or "snapshot" for a recent development version.'
7+
default: 'snapshot'
8+
119
runs:
1210
using: 'node12'
1311
main: 'dist/index.js'
12+
1413
branding:
1514
icon: 'code'
16-
color: 'yellow'
15+
color: 'yellow'

0 commit comments

Comments
 (0)