Skip to content

Commit

Permalink
Use GHA matrix to test multiple versions of go and python
Browse files Browse the repository at this point in the history
  • Loading branch information
shanemcd committed Feb 13, 2022
1 parent 55094d6 commit be7e9a8
Showing 1 changed file with 47 additions and 43 deletions.
90 changes: 47 additions & 43 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,52 +32,20 @@ jobs:

- name: Run receptorctl linters
run: make receptorctl-lint
build:
name: build
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17

- uses: actions/cache@v2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Checkout
uses: actions/checkout@v2

- name: build-all target
run: make build-all

- name: Archive binary
uses: actions/upload-artifact@v2
with:
name: receptor
path: receptor
test:
name: test
receptor:
name: receptor (Go ${{ matrix.go-version }})
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.16, 1.17]
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17

- name: Setup up python
uses: actions/setup-python@v2

- name: Install tox (for python tests)
run: sudo apt-get install tox
go-version: ${{ matrix.go-version }}

- uses: actions/cache@v2
with:
Expand All @@ -88,8 +56,10 @@ jobs:
restore-keys: |
${{ runner.os }}-go-
- name: install receptor
run: go build -o $GOROOT/bin/receptor ./cmd/receptor-cl
- name: build and install receptor
run: |
make build-all
sudo cp ./receptor /usr/local/bin/receptor
- name: Download kind binary
run: curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.11.1/kind-linux-amd64 && chmod +x ./kind
Expand All @@ -100,9 +70,6 @@ jobs:
- name: Interact with the cluster
run: kubectl get nodes

- name: Run receptorctl tests
run: make receptorctl-test

- name: Run receptor tests
run: make test

Expand All @@ -116,3 +83,40 @@ jobs:
with:
name: test-logs
path: /tmp/receptor-testing

- name: Archive receptor binary
uses: actions/upload-artifact@v2
with:
name: receptor
path: /usr/local/bin/receptor

receptorctl:
name: receptorctl (Python ${{ matrix.python-version }})
needs: receptor
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9]
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Download receptor
uses: actions/download-artifact@v2
with:
name: receptor
path: /usr/local/bin/

- name: Fix permissions on receptor binary
run: sudo chmod a+x /usr/local/bin/receptor

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}

- name: Install tox
run: sudo apt-get install tox

- name: Run receptorctl tests
run: make receptorctl-test

0 comments on commit be7e9a8

Please sign in to comment.