-
Notifications
You must be signed in to change notification settings - Fork 1k
GitHub Actions #9083
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
GitHub Actions #9083
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
9cf222c
GitHub Actions
di 1aa1b53
Use GITHUB_BASE_REF instead
di f1a9d45
Add conditionals
di 24e90f8
Add missing check for CI
di 5bea462
Split linting, and lint in container
di 638e263
Guard against bad diff
di a40a042
Why not do reformat as well while we're at it
di c246786
Merge branch 'main' into github-actions-ci
ewdurbin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,99 @@ | ||
name: CI | ||
on: [push, pull_request] | ||
jobs: | ||
test: | ||
strategy: | ||
matrix: | ||
include: | ||
- name: Tests | ||
command: bin/tests --postgresql-host localhost | ||
needs-python: ${{ true }} | ||
di marked this conversation as resolved.
Show resolved
Hide resolved
|
||
needs-node: ${{ false }} | ||
- name: Lint | ||
command: bin/lint | ||
needs-python: ${{ true }} | ||
needs-node: ${{ false }} | ||
- name: Documentation | ||
command: make docs BINDIR="$(dirname $(which python))" | ||
needs-python: ${{ true }} | ||
needs-node: ${{ false }} | ||
- name: Dependencies | ||
command: make github-actions-deps BINDIR="$(dirname $(which python))" | ||
needs-python: ${{ true }} | ||
needs-node: ${{ false }} | ||
- name: Licenses | ||
command: make licenses BINDIR="$(dirname $(which python))" | ||
needs-python: ${{ true }} | ||
needs-node: ${{ false }} | ||
- name: Translations | ||
command: make translations BINDIR="$(dirname $(which python))" | ||
needs-python: ${{ true }} | ||
needs-node: ${{ false }} | ||
- name: Static Tests | ||
command: bin/static_tests | ||
needs-python: ${{ false }} | ||
needs-node: ${{ true }} | ||
- name: Static Lint | ||
command: bin/static_lint | ||
needs-python: ${{ false }} | ||
needs-node: ${{ true }} | ||
- name: Static Pipeline | ||
command: bin/static_pipeline | ||
needs-python: ${{ false }} | ||
needs-node: ${{ true }} | ||
runs-on: ubuntu-latest | ||
services: | ||
postgres: | ||
image: postgres:10.1 | ||
ports: | ||
- 5432:5432 | ||
name: ${{ matrix.name }} | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v2 | ||
- name: Install platform dependencies | ||
run: sudo apt -y install libcurl4-openssl-dev libssl-dev pkg-config | ||
- uses: actions/setup-python@v2 | ||
if: ${{ matrix.needs-python }} | ||
with: | ||
python-version: 3.8.2 | ||
- name: Cache Python dependencies | ||
if: ${{ matrix.needs-python }} | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: warehouse-cache-pip | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('requirements.txt', 'requirements/*.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}- | ||
${{ runner.os }}-${{ github.job }}- | ||
${{ runner.os }}- | ||
- name: Install Python dependencies | ||
if: ${{ matrix.needs-python }} | ||
run: | | ||
pip install -U pip setuptools wheel | ||
pip install -r requirements.txt | ||
pip install -r requirements/dev.txt | ||
- uses: actions/setup-node@v2 | ||
if: ${{ matrix.needs-node }} | ||
with: | ||
node-version: 14.4.0 | ||
di marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- name: Cache Node dependencies | ||
if: ${{ matrix.needs-node }} | ||
uses: actions/cache@v2 | ||
env: | ||
cache-name: warehouse-cache-npm | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-build-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-build-${{ github.job }}-${{ env.cache-name }}- | ||
${{ runner.os }}-build-${{ github.job }}- | ||
${{ runner.os }}-build- | ||
${{ runner.os }}- | ||
- name: Install Node dependencies | ||
if: ${{ matrix.needs-node }} | ||
run: npm ci | ||
- name: Run ${{ matrix.name }} | ||
run: ${{ matrix.command }} |
This file contains hidden or 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 hidden or 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 hidden or 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,20 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# Click requires us to ensure we have a well configured environment to run | ||
# our click commands. So we'll set our environment to ensure our locale is | ||
# correct. | ||
export LC_ALL="${ENCODING:-en_US.UTF-8}" | ||
export LANG="${ENCODING:-en_US.UTF-8}" | ||
|
||
COMMAND_ARGS=$@ | ||
|
||
# Print all the followng commands | ||
set -x | ||
|
||
# Actually run our tests. | ||
python -m flake8 . | ||
python -m black --check *.py warehouse/ tests/ | ||
python -m isort --check *.py warehouse/ tests/ | ||
python -m doc8 --allow-long-titles README.rst CONTRIBUTING.rst docs/ --ignore-path docs/_build/ | ||
python -m curlylint ./warehouse/templates |
This file contains hidden or 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,14 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
# Click requires us to ensure we have a well configured environment to run | ||
# our click commands. So we'll set our environment to ensure our locale is | ||
# correct. | ||
export LC_ALL="${ENCODING:-en_US.UTF-8}" | ||
export LANG="${ENCODING:-en_US.UTF-8}" | ||
|
||
# Print all the followng commands | ||
set -x | ||
|
||
python -m isort *.py warehouse/ tests/ | ||
python -m black *.py warehouse/ tests/ |
This file contains hidden or 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,13 @@ | ||
#!/bin/bash | ||
set -e | ||
set -x | ||
|
||
# Click requires us to ensure we have a well configured environment to run | ||
# our click commands. So we'll set our environment to ensure our locale is | ||
# correct. | ||
export LC_ALL="${ENCODING:-en_US.UTF-8}" | ||
export LANG="${ENCODING:-en_US.UTF-8}" | ||
|
||
# Actually run our tests. | ||
./node_modules/.bin/eslint 'warehouse/static/js/**' '**.js' 'tests/frontend/**' --ignore-pattern 'warehouse/static/js/vendor/**' | ||
./node_modules/.bin/sass-lint --verbose |
This file contains hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.