-
-
Notifications
You must be signed in to change notification settings - Fork 63
ci: Start using github actions for CI #235
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
Changes from all commits
7d274cc
307e226
ec5cfa8
5c2de66
28ec04f
b8987e1
62aeebe
45f5b8f
42b372f
6bf746b
c7a85a4
f4246c7
f094376
ffbce5f
35c8161
b39509b
2e82d0c
461a70c
78f0f7e
e7633be
8d42e5b
5b75aa2
1c31851
c3ecc44
a9abbf7
c2c818f
cc75a77
a2da557
6383459
a31286d
d4b4681
e20f55b
d5056bc
bd33e88
1f428b9
4295645
cba53cc
ce0e9e6
50f1135
82b7b14
561bb8b
b3d10bb
52dbb17
2eb130e
9ede8d1
eafab8a
a090f8c
6045095
75c176f
49dc5ef
60088f3
bc5771b
f11e867
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Release build | ||
|
||
on: | ||
push: | ||
branches: | ||
- release/** | ||
|
||
jobs: | ||
docs: | ||
name: Build and upload Linux release and docs | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
|
||
- name: Build symbolicator | ||
run: | | ||
cargo build --release | ||
objcopy --only-keep-debug target/release/symbolicator{,.debug} | ||
objcopy --strip-debug --strip-unneeded target/release/symbolicator | ||
objcopy --add-gnu-debuglink target/release/symbolicator{.debug,} | ||
zip symbolicator-debug.zip target/release/symbolicator.debug | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Setup python dependencies | ||
run: pip install --upgrade mkdocs mkdocs-material pygments | ||
|
||
- name: Build Docs | ||
run: | | ||
mkdocs build | ||
touch site/.nojekyll | ||
cd site && zip -r gh-pages . | ||
|
||
- name: Setup node | ||
uses: actions/setup-node@v1 | ||
|
||
- name: Upload to Zeus | ||
env: | ||
ZEUS_HOOK_BASE: ${{ secrets.ZEUS_HOOK_BASE }} | ||
run: | | ||
npm install -D @zeus-ci/cli | ||
npx zeus job update -b ${{ github.run_id }} -j ${{ github.job }} -r ${{ github.sha }} | ||
npx zeus upload -b ${{ github.run_id }} -j ${{ github.job }} -t "application/octet-stream" -n symbolicator-Linux-x86_64 target/release/symbolicator | ||
npx zeus upload -b ${{ github.run_id }} -j ${{ github.job }} -t "application/zip" -n symbolicator-Linux-x86_64-debug.zip symbolicator-debug.zip | ||
npx zeus upload -b ${{ github.run_id }} -j ${{ github.job }} -t "application/zip+docs" site/gh-pages.zip | ||
npx zeus job update --status=passed -b ${{ github.run_id }} -j ${{ github.job }} -r ${{ github.sha }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- release/** | ||
|
||
pull_request: | ||
|
||
jobs: | ||
lints: | ||
name: Lints | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Install python dependencies | ||
run: pip install --upgrade black flake8 | ||
|
||
- name: Run Black | ||
run: black --check tests | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Q: should we use this directly instead of makefile for symbolic as well? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since we're going with explicit commands now, I would say yes. The makefile becomes an interface for the developer, and CI has it's own (equivalent or equal) commands. |
||
|
||
- name: Run Flake8 | ||
run: flake8 tests | ||
|
||
- name: Install rust stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
components: rustfmt, clippy | ||
override: true | ||
|
||
- name: Cache rust cargo artifacts | ||
uses: swatinem/rust-cache@v1 | ||
with: | ||
key: ${{ github.job }} | ||
|
||
- name: Run cargo fmt | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: fmt | ||
args: --all -- --check | ||
|
||
- name: Run clipppy | ||
uses: actions-rs/clippy-check@v1 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
args: --all-features --workspace --tests --examples -- -D clippy::all | ||
|
||
unit-test: | ||
name: Unit Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install rust stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
override: true | ||
|
||
- name: Cache rust cargo artifacts | ||
uses: swatinem/rust-cache@v1 | ||
with: | ||
key: ${{ github.job }} | ||
|
||
- name: Run cargo test | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --workspace --all-features --locked | ||
|
||
integration-test: | ||
name: Integration Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install rust stable toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
profile: minimal | ||
override: true | ||
|
||
- name: Cache rust cargo artifacts | ||
uses: swatinem/rust-cache@v1 | ||
with: | ||
key: ${{ github.job }} | ||
|
||
- name: Build rust | ||
run: cargo build --locked | ||
|
||
- name: Install python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Setup python environment | ||
run: pip install --upgrade pytest pytest-localserver requests pytest-xdist pytest-icdiff boto3 | ||
|
||
- name: Integration tests | ||
env: | ||
SENTRY_SYMBOLICATOR_GCS_CLIENT_EMAIL: ${{ secrets.SENTRY_SYMBOLICATOR_GCS_CLIENT_EMAIL }} | ||
SENTRY_SYMBOLICATOR_GCS_PRIVATE_KEY: ${{ secrets.SENTRY_SYMBOLICATOR_GCS_PRIVATE_KEY }} | ||
SENTRY_SYMBOLICATOR_TEST_AWS_ACCESS_KEY_ID: ${{ secrets.SENTRY_SYMBOLICATOR_TEST_AWS_ACCESS_KEY_ID }} | ||
SENTRY_SYMBOLICATOR_TEST_AWS_SECRET_ACCESS_KEY: ${{ secrets.SENTRY_SYMBOLICATOR_TEST_AWS_SECRET_ACCESS_KEY }} | ||
run: pytest --ci -n12 -vv tests/integration | ||
|
||
docs: | ||
name: Build docs | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
|
||
- name: Setup python dependencies | ||
run: pip install --upgrade mkdocs mkdocs-material pygments | ||
|
||
- name: Build Docs | ||
run: mkdocs build |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,16 @@ | |
session = requests.session() | ||
|
||
|
||
@pytest.hookimpl | ||
def pytest_addoption(parser): | ||
parser.addoption( | ||
"--ci", | ||
action="store_true", | ||
help="Indicate the tests are being run on CI, " | ||
"this e.g. prefers to fail tests instead of skipping them.", | ||
) | ||
|
||
|
||
@pytest.hookimpl | ||
def pytest_sessionstart(session): | ||
no_fds_soft, no_fds_hard = resource.getrlimit(resource.RLIMIT_NOFILE) | ||
|
@@ -271,9 +281,13 @@ def fail_on_errors(): | |
|
||
|
||
@pytest.fixture | ||
def s3(): | ||
def s3(pytestconfig): | ||
if not AWS_ACCESS_KEY_ID or not AWS_SECRET_ACCESS_KEY: | ||
pytest.skip("No AWS credentials") | ||
msg = "No AWS credentials" | ||
if pytestconfig.getoption("ci"): | ||
pytest.fail(msg) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In theory this kind of stuff could be monitored by measuring coverage on the testsuite itself. Then you can find tests that are improperly skipped or not discovered at all for whatever reason. In practice it's much harder to set up. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that could work if you have a 100% test coverage enforced. But anything less and it probably doesn't. I like one global that you can use to potentially skip things on local workstations. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I mean testing coverage of the code in |
||
else: | ||
pytest.skip(msg) | ||
return boto3.resource( | ||
"s3", | ||
aws_access_key_id=AWS_ACCESS_KEY_ID, | ||
|
@@ -299,9 +313,13 @@ def s3_bucket_config(s3): | |
|
||
|
||
@pytest.fixture | ||
def ios_bucket_config(): | ||
def ios_bucket_config(pytestconfig): | ||
if not GCS_PRIVATE_KEY or not GCS_CLIENT_EMAIL: | ||
pytest.skip("No GCS credentials") | ||
msg = "No GCS credentials" | ||
if pytestconfig.getoption("ci"): | ||
pytest.fail(msg) | ||
else: | ||
pytest.skip(msg) | ||
yield { | ||
"id": "ios", | ||
"type": "gcs", | ||
|
Uh oh!
There was an error while loading. Please reload this page.