Skip to content

Commit 7e2528c

Browse files
committed
Fix set-env, format with yml
1 parent 84c7c3e commit 7e2528c

File tree

2 files changed

+150
-151
lines changed

2 files changed

+150
-151
lines changed

.github/workflows/publish-docs.yml

+74-75
Original file line numberDiff line numberDiff line change
@@ -7,94 +7,93 @@ on:
77

88
jobs:
99
build:
10-
1110
runs-on: ubuntu-latest
1211
strategy:
1312
matrix:
14-
python-version: [ '3.x' ]
13+
python-version: ["3.x"]
1514
steps:
16-
- uses: actions/checkout@v1
17-
- name: Configure git
18-
run: |
19-
git config --global user.name 'travis-ci'
20-
git config --global user.email '[email protected]'
21-
- name: Set up Python ${{ matrix.python-version }}
22-
uses: actions/setup-python@v1
23-
with:
24-
python-version: ${{ matrix.python-version }}
15+
- uses: actions/checkout@v1
16+
- name: Configure git
17+
run: |
18+
git config --global user.name 'travis-ci'
19+
git config --global user.email '[email protected]'
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v1
22+
with:
23+
python-version: ${{ matrix.python-version }}
2524

26-
- name: Get full Python version
27-
id: full-python-version
28-
shell: bash
29-
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
25+
- name: Get full Python version
26+
id: full-python-version
27+
shell: bash
28+
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
3029

31-
- name: Install poetry
32-
run: |
33-
curl -O -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py
34-
python get-poetry.py -y --version 1.0.10
35-
echo "::set-env name=PATH::$HOME/.poetry/bin:$PATH"
36-
rm get-poetry.py
30+
- name: Install poetry
31+
run: |
32+
curl -O -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py
33+
python get-poetry.py -y --version 1.0.10
34+
echo "PATH=${HOME}/.poetry/bin:${PATH}" >> $GITHUB_ENV
35+
rm get-poetry.py
3736
38-
- name: Get poetry cache paths from config
39-
run: |
40-
echo ::set-env name=poetry_cache_dir::$(poetry config --list | sed -n 's/.*cache-dir = //p' | sed -e 's/^"//' -e 's/"$//')
41-
echo ::set-env name=poetry_virtualenvs_path::$(poetry config --list | sed -n 's/.*virtualenvs.path = .* # //p' | sed -e 's/^"//' -e 's/"$//')
37+
- name: Get poetry cache paths from config
38+
run: |
39+
echo "poetry_virtualenvs_path=$(poetry config --list | sed -n 's/.*virtualenvs.path = .* # //p' | sed -e 's/^\"//' -e 's/\"$//')" >> $GITHUB_ENV
40+
echo "poetry_virtualenvs_path=$(poetry config --list | sed -n 's/.*virtualenvs.path = .* # //p' | sed -e 's/^\"//' -e 's/\"$//')" >> $GITHUB_ENV
4241
43-
- name: Configure poetry
44-
shell: bash
45-
run: poetry config virtualenvs.in-project true
42+
- name: Configure poetry
43+
shell: bash
44+
run: poetry config virtualenvs.in-project true
4645

47-
- name: Set up cache
48-
uses: actions/cache@v2
49-
id: cache
50-
with:
51-
path: |
52-
.venv
53-
{{ env.poetry_cache_dir }}
54-
{{ env.poetry_virtualenvs_path }}
55-
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
46+
- name: Set up cache
47+
uses: actions/cache@v2
48+
id: cache
49+
with:
50+
path: |
51+
.venv
52+
{{ env.poetry_cache_dir }}
53+
{{ env.poetry_virtualenvs_path }}
54+
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
5655

57-
- name: Ensure cache is healthy
58-
if: steps.cache.outputs.cache-hit == 'true'
59-
shell: bash
60-
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
56+
- name: Ensure cache is healthy
57+
if: steps.cache.outputs.cache-hit == 'true'
58+
shell: bash
59+
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
6160

62-
- name: Upgrade pip
63-
shell: bash
64-
run: poetry run python -m pip install pip -U
61+
- name: Upgrade pip
62+
shell: bash
63+
run: poetry run python -m pip install pip -U
6564

66-
- name: Install dependencies [w/ docs]
67-
run: poetry install --extras "docs lint"
65+
- name: Install dependencies [w/ docs]
66+
run: poetry install --extras "docs lint"
6867

69-
- name: Build documentation
70-
run: |
71-
pushd docs; make SPHINXBUILD='poetry run sphinx-build' html; popd
68+
- name: Build documentation
69+
run: |
70+
pushd docs; make SPHINXBUILD='poetry run sphinx-build' html; popd
7271
73-
- name: Push documentation to S3
74-
uses: jakejarvis/s3-sync-action@master
75-
with:
76-
args: --acl public-read --follow-symlinks --delete
77-
env:
78-
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
79-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
80-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
81-
AWS_REGION: 'us-west-1' # optional: defaults to us-east-1
82-
SOURCE_DIR: 'docs/_build/html' # optional: defaults to entire repository
72+
- name: Push documentation to S3
73+
uses: jakejarvis/s3-sync-action@master
74+
with:
75+
args: --acl public-read --follow-symlinks --delete
76+
env:
77+
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
78+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
79+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
80+
AWS_REGION: "us-west-1" # optional: defaults to us-east-1
81+
SOURCE_DIR: "docs/_build/html" # optional: defaults to entire repository
8382

84-
- name: Generate list of changed files for CloudFront to invalidate
85-
run: |
86-
pushd docs/_build/html; FILES=$(find . -name \* -print | grep html | cut -c2- | sort | uniq | tr '\n' ' '); popd
87-
for file in $FILES; do
88-
echo $file
89-
# add bare directory to list of updated paths when we see index.html
90-
[[ "$file" == *"/index.html" ]] && echo $file | sed -e 's/\/index.html$/\//'
91-
done | sort | uniq | tr '\n' ' ' > .updated_files
83+
- name: Generate list of changed files for CloudFront to invalidate
84+
run: |
85+
pushd docs/_build/html; FILES=$(find . -name \* -print | grep html | cut -c2- | sort | uniq | tr '\n' ' '); popd
86+
for file in $FILES; do
87+
echo $file
88+
# add bare directory to list of updated paths when we see index.html
89+
[[ "$file" == *"/index.html" ]] && echo $file | sed -e 's/\/index.html$/\//'
90+
done | sort | uniq | tr '\n' ' ' > .updated_files
9291
93-
- name: Invalidate on CloudFront
94-
uses: chetan/invalidate-cloudfront-action@master
95-
env:
96-
DISTRIBUTION: ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION }}
97-
AWS_REGION: 'us-east-1'
98-
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
99-
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
100-
PATHS_FROM: .updated_files
92+
- name: Invalidate on CloudFront
93+
uses: chetan/invalidate-cloudfront-action@master
94+
env:
95+
DISTRIBUTION: ${{ secrets.AWS_CLOUDFRONT_DISTRIBUTION }}
96+
AWS_REGION: "us-east-1"
97+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
98+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
99+
PATHS_FROM: .updated_files

.github/workflows/tests.yml

+76-76
Original file line numberDiff line numberDiff line change
@@ -10,91 +10,91 @@ jobs:
1010
runs-on: ubuntu-latest
1111
strategy:
1212
matrix:
13-
python-version: [ '2.7', '3.x' ]
14-
tmux-version: [ '2.6', '2.7', '2.8', '3.0a', '3.1b', 'master' ]
13+
python-version: ["2.7", "3.x"]
14+
tmux-version: ["2.6", "2.7", "2.8", "3.0a", "3.1b", "master"]
1515
steps:
16-
- uses: actions/checkout@v1
16+
- uses: actions/checkout@v1
1717

18-
- name: Set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v1
20-
with:
21-
python-version: ${{ matrix.python-version }}
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v1
20+
with:
21+
python-version: ${{ matrix.python-version }}
2222

23-
- name: Get full Python version
24-
id: full-python-version
25-
shell: bash
26-
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
23+
- name: Get full Python version
24+
id: full-python-version
25+
shell: bash
26+
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
2727

28-
- name: Install poetry
29-
run: |
30-
curl -O -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py
31-
python get-poetry.py -y --version 1.0.10
32-
echo "::set-env name=PATH::$HOME/.poetry/bin:$PATH"
33-
rm get-poetry.py
28+
- name: Install poetry
29+
run: |
30+
curl -O -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py
31+
python get-poetry.py -y --version 1.0.10
32+
echo "PATH=${HOME}/.poetry/bin:${PATH}" >> $GITHUB_ENV
33+
rm get-poetry.py
3434
35-
- name: Get poetry cache paths from config
36-
run: |
37-
echo ::set-env name=poetry_cache_dir::$(poetry config --list | sed -n 's/.*cache-dir = //p' | sed -e 's/^"//' -e 's/"$//')
38-
echo ::set-env name=poetry_virtualenvs_path::$(poetry config --list | sed -n 's/.*virtualenvs.path = .* # //p' | sed -e 's/^"//' -e 's/"$//')
35+
- name: Get poetry cache paths from config
36+
run: |
37+
echo "poetry_virtualenvs_path=$(poetry config --list | sed -n 's/.*virtualenvs.path = .* # //p' | sed -e 's/^\"//' -e 's/\"$//')" >> $GITHUB_ENV
38+
echo "poetry_virtualenvs_path=$(poetry config --list | sed -n 's/.*virtualenvs.path = .* # //p' | sed -e 's/^\"//' -e 's/\"$//')" >> $GITHUB_ENV
3939
40-
- name: Configure poetry
41-
shell: bash
42-
run: poetry config virtualenvs.in-project true
40+
- name: Configure poetry
41+
shell: bash
42+
run: poetry config virtualenvs.in-project true
4343

44-
- name: Set up poetry cache
45-
uses: actions/cache@v2
46-
id: cache
47-
with:
48-
path: |
49-
.venv
50-
{{ env.poetry_cache_dir }}
51-
{{ env.poetry_virtualenvs_path }}
52-
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
44+
- name: Set up poetry cache
45+
uses: actions/cache@v2
46+
id: cache
47+
with:
48+
path: |
49+
.venv
50+
{{ env.poetry_cache_dir }}
51+
{{ env.poetry_virtualenvs_path }}
52+
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }}
5353

54-
- name: Ensure cache is healthy
55-
if: steps.cache.outputs.cache-hit == 'true'
56-
shell: bash
57-
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
54+
- name: Ensure cache is healthy
55+
if: steps.cache.outputs.cache-hit == 'true'
56+
shell: bash
57+
run: poetry run pip --version >/dev/null 2>&1 || rm -rf .venv
5858

59-
- name: Setup tmux build cache for tmux ${{ matrix.tmux-version }}
60-
id: tmux-build-cache
61-
uses: actions/cache@v1
62-
with:
63-
path: ~/tmux-builds/tmux-${{ matrix.tmux-version }}
64-
key: tmux-${{ matrix.tmux-version }}
59+
- name: Setup tmux build cache for tmux ${{ matrix.tmux-version }}
60+
id: tmux-build-cache
61+
uses: actions/cache@v1
62+
with:
63+
path: ~/tmux-builds/tmux-${{ matrix.tmux-version }}
64+
key: tmux-${{ matrix.tmux-version }}
6565

66-
- name: Build tmux ${{ matrix.tmux-version }}
67-
if: steps.tmux-build-cache.outputs.cache-hit != 'true'
68-
run: |
69-
sudo apt install libevent-dev libncurses5-dev libtinfo-dev libutempter-dev bison
70-
mkdir ~/tmux-builds
71-
mkdir ~/tmux-src
72-
git clone https://github.com/tmux/tmux.git ~/tmux-src/tmux-${{ matrix.tmux-version }}
73-
cd ~/tmux-src/tmux-${{ matrix.tmux-version }}
74-
git checkout ${{ matrix.tmux-version }}
75-
sh autogen.sh
76-
./configure --prefix=$HOME/tmux-builds/tmux-${{ matrix.tmux-version }} && make && make install
77-
export PATH=$HOME/tmux-builds/tmux-${{ matrix.tmux-version }}/bin:$PATH
78-
cd ~
79-
tmux -V
66+
- name: Build tmux ${{ matrix.tmux-version }}
67+
if: steps.tmux-build-cache.outputs.cache-hit != 'true'
68+
run: |
69+
sudo apt install libevent-dev libncurses5-dev libtinfo-dev libutempter-dev bison
70+
mkdir ~/tmux-builds
71+
mkdir ~/tmux-src
72+
git clone https://github.com/tmux/tmux.git ~/tmux-src/tmux-${{ matrix.tmux-version }}
73+
cd ~/tmux-src/tmux-${{ matrix.tmux-version }}
74+
git checkout ${{ matrix.tmux-version }}
75+
sh autogen.sh
76+
./configure --prefix=$HOME/tmux-builds/tmux-${{ matrix.tmux-version }} && make && make install
77+
export PATH=$HOME/tmux-builds/tmux-${{ matrix.tmux-version }}/bin:$PATH
78+
cd ~
79+
tmux -V
8080
81-
- name: Upgrade pip
82-
shell: bash
83-
run: poetry run python -m pip install pip -U
81+
- name: Upgrade pip
82+
shell: bash
83+
run: poetry run python -m pip install pip -U
8484

85-
- name: Install python dependencies
86-
run: |
87-
poetry install -E "test coverage lint"
88-
- name: Lint with flake8
89-
run: |
90-
poetry run flake8
91-
- name: Test with pytest
92-
continue-on-error: ${{ matrix.tmux-version == 'master' }}
93-
run: |
94-
export PATH=$HOME/tmux-builds/tmux-${{ matrix.tmux-version }}/bin:$PATH
95-
ls $HOME/tmux-builds/tmux-${{ matrix.tmux-version }}/bin
96-
tmux -V
97-
poetry run py.test --cov=./ --cov-report=xml
98-
- uses: codecov/codecov-action@v1
99-
with:
100-
token: ${{ secrets.CODECOV_TOKEN }}
85+
- name: Install python dependencies
86+
run: |
87+
poetry install -E "test coverage lint"
88+
- name: Lint with flake8
89+
run: |
90+
poetry run flake8
91+
- name: Test with pytest
92+
continue-on-error: ${{ matrix.tmux-version == 'master' }}
93+
run: |
94+
export PATH=$HOME/tmux-builds/tmux-${{ matrix.tmux-version }}/bin:$PATH
95+
ls $HOME/tmux-builds/tmux-${{ matrix.tmux-version }}/bin
96+
tmux -V
97+
poetry run py.test --cov=./ --cov-report=xml
98+
- uses: codecov/codecov-action@v1
99+
with:
100+
token: ${{ secrets.CODECOV_TOKEN }}

0 commit comments

Comments
 (0)