Skip to content

Commit

Permalink
ci: migrate spread tests to github actions (#3375)
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Patterson <[email protected]>
  • Loading branch information
Chris Patterson authored Dec 4, 2020
1 parent d2f3184 commit 6c59e9f
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 6 deletions.
14 changes: 14 additions & 0 deletions .github/spread-problem-matcher.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"problemMatcher": [
{
"owner": "spread-error",
"pattern": [
{
"regexp": "^\\d+-\\d+-\\d+ \\d+:\\d+:\\d+ ((Error) (preparing|executing|restoring) .+) : .*$",
"message": 1,
"severity": 2
}
]
}
]
}
70 changes: 70 additions & 0 deletions .github/workflows/spread.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Spread Tests

on: [pull_request]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout snapcraft
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Build snapcraft snap
id: build-snapcraft
uses: snapcore/action-build@v1

- name: Upload snapcraft snap
uses: actions/upload-artifact@v2
with:
name: snap
path: ${{ steps.build-snapcraft.outputs.snap }}

- name: Verify snapcraft snap
run: |
sudo snap install --dangerous --classic ${{ steps.build-snapcraft.outputs.snap }}
integration-spread-tests:
runs-on: ubuntu-latest
needs: build
strategy:
# FIXME: enable fail-fast mode once spread can cancel an executing job.
# Disable fail-fast mode as it doesn't function with spread. It seems
# that cancelling tasks requires short, interruptible actions and
# interrupting spread, notably, does not work today. As such disable
# fail-fast while we tackle that problem upstream.
fail-fast: false
matrix:
spread-jobs:
- google:ubuntu-16.04-64
- google:ubuntu-18.04-64
- google:ubuntu-20.04-64

steps:
- name: Checkout snapcraft
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Download snapcraft snap
uses: actions/download-artifact@v2
with:
name: snap

- name: Install spread
run: curl -s https://niemeyer.s3.amazonaws.com/spread-amd64.tar.gz | sudo tar xzv -C /usr/bin

- name: Run spread
env:
SPREAD_GOOGLE_KEY: ${{ secrets.SPREAD_GOOGLE_KEY }}
run: spread ${{ matrix.spread-jobs }}

- name: Discard spread workers
if: always()
run: |
shopt -s nullglob
for r in .spread-reuse.*.yaml; do
spread -discard -reuse-pid="$(echo "$r" | grep -o -E '[0-9]+')"
done
6 changes: 0 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@ jobs:
use: snaps
if: (type = pull_request) AND (head_repo = "snapcore/snapcraft")
script: ./tools/travis_deploy.sh
- stage: integration
name: spread
workspaces:
use: snaps
if: repo = "snapcore/snapcraft" or env(SPREAD_GOOGLE_KEY) IS present
script: ./runtests.sh spread "google:"
- stage: integration
name: store
workspaces:
Expand Down

0 comments on commit 6c59e9f

Please sign in to comment.