Skip to content

Instantly share code, notes, and snippets.

View markphelps's full-sized avatar

Mark Phelps markphelps

View GitHub Profile
# Get values for cache paths to be used in later steps
- id: go-cache-paths
run: |
echo "::set-output name=go-build::$(go env GOCACHE)"
echo "::set-output name=go-mod::$(go env GOMODCACHE)"
- name: Checkout
uses: actions/checkout@v2
# Cache go build cache, used to speedup go test
- name: Release
run: ./script/build/release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
- name: Test CLI
uses: actions/bin/bats@master
with:
args: ./script/test/*.bats
services:
postgres:
image: postgres:11
ports:
- 5432:5432
env:
POSTGRES_DB: flipt_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ''
steps:
- name: Setup Go
uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go }}
id: go
test:
name: Test
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go: ['1.12', '1.13']
name: Publish Docs
uses: ./.github/actions/publish-docs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FROM python:2.7
RUN pip install mkdocs mkdocs-material pygments
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
func fixture(path string) string {
b, err := ioutil.ReadFile("testdata/fixtures/" + path)
if err != nil {
panic(err)
}
return string(b)
}
func TestListRepos(t *testing.T) {
teardown := setup()
func TestListRepos(t *testing.T) {
teardown := setup()
defer teardown()
mux.HandleFunc("/orgs/octokit/repos", func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(http.StatusOK)
// ... return the JSON
})