generated from actions/container-action
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run default and integration tests on commit
Update the GitHub Action to run the tests in both default mode (with virtualised service calls), and integration mode (with calls to the real GitHub API).
- Loading branch information
Showing
3 changed files
with
50 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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 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,40 @@ | ||
--- | ||
on: [push] # yamllint disable-line rule:truthy | ||
name: Tests | ||
jobs: | ||
tests: | ||
name: Virtual | ||
strategy: | ||
matrix: | ||
go-version: [1.14.x] | ||
os: [ubuntu-latest] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Install Hoverfly | ||
working-directory: ${{ runner.temp }} | ||
run: | | ||
mkdir -p $GITHUB_WORKSPACE/bin | ||
export HOVERFLY_PLATFORM=linux_amd64 | ||
export HOVERFLY_VERSION=v1.3.0 | ||
export HOVERFLY_BUNDLE=hoverfly_bundle_$HOVERFLY_PLATFORM | ||
export HOVERFLY_DOWNLOAD_URL=https://github.com/SpectoLabs/hoverfly/releases/download/ | ||
wget $HOVERFLY_DOWNLOAD_URL$HOVERFLY_VERSION/$HOVERFLY_BUNDLE.zip | ||
unzip $HOVERFLY_BUNDLE.zip | ||
mv hoverfly $GITHUB_WORKSPACE/bin/ | ||
mv hoverctl $GITHUB_WORKSPACE/bin/ | ||
echo "::add-path::$GITHUB_WORKSPACE/bin" | ||
chmod +x $GITHUB_WORKSPACE/bin/hoverfly | ||
chmod +x $GITHUB_WORKSPACE/bin/hoverctl | ||
- name: Add and trust Hoverfly default certificate | ||
run: | | ||
wget https://raw.githubusercontent.com/SpectoLabs/hoverfly/master/core/cert.pem | ||
sudo mv cert.pem /usr/local/share/ca-certificates/hoverfly.crt | ||
sudo update-ca-certificates | ||
- name: Tests | ||
run: go test -v . |
This file contains 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,8 @@ | ||
--- | ||
extends: default | ||
|
||
rules: | ||
# 120 chars should be enough, but don't fail if a line is longer | ||
line-length: | ||
max: 120 | ||
level: warning |