Skip to content
This repository was archived by the owner on Sep 17, 2025. It is now read-only.

Commit 0d01853

Browse files
authored
replace travis (part 2): run tests in github actions (#980)
* replace travis (part 2): run tests in github actions * undo azure test change * log WEBSITE_SITE_NAME * log more * mock out azure metadata server, which exists in GHA environment * split out lint, setup, docs * Revert "split out lint, setup, docs" This reverts commit 44b1c7d. * skip test
1 parent 868640c commit 0d01853

File tree

3 files changed

+32
-25
lines changed

3 files changed

+32
-25
lines changed

.github/workflows/build.yml

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,34 @@ on:
77

88
jobs:
99
build:
10-
runs-on: ubuntu-20.04
10+
# 18.04 needed for python3.4
11+
runs-on: ubuntu-18.04
12+
env:
13+
# We use these variables to convert between tox and GHA version literals
14+
py27: 2.7
15+
py34: 3.4
16+
py35: 3.5
17+
py36: 3.6
18+
py37: 3.7
19+
strategy:
20+
# ensures the entire test matrix is run, even if one permutation fails
21+
fail-fast: false
22+
matrix:
23+
python-version: [py27, py34, py35, py36, py37]
1124
steps:
12-
- uses: actions/checkout@v2
13-
- name: Build and test
14-
run: echo "Hello world!"
25+
- name: Checkout code
26+
uses: actions/checkout@v2
27+
- name: Set up Python ${{ env[matrix.python-version] }}
28+
uses: actions/setup-python@v2
29+
with:
30+
python-version: ${{ env[matrix.python-version] }}
31+
- name: Install tox
32+
run: pip install -U tox-factor
33+
- name: Cache tox environment
34+
uses: actions/cache@v2
35+
with:
36+
path: .tox
37+
# bump version prefix to fully reset caches
38+
key: v1-tox-${{ matrix.python-version }}-${{ hashFiles('tox.ini') }}
39+
- name: run tox
40+
run: tox -f ${{ matrix.python-version }}

.travis.yml

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

contrib/opencensus-ext-azure/tests/test_azure_heartbeat_metrics.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ def test_heartbeat_metric_init(self):
8989
self.assertFalse(metric.init)
9090
self.assertEqual(len(metric.properties), 0)
9191

92+
# TODO @lzchen #981
93+
@unittest.skip("Failing because github workflow runs on Azure")
9294
def test_heartbeat_metric_get_metric_init(self):
9395
metric = heartbeat_metrics.HeartbeatMetric()
9496
self.assertFalse(metric.init)

0 commit comments

Comments
 (0)