2020-05-21 06:30:41 +00:00
|
|
|
name: e2e test
|
|
|
|
on:
|
|
|
|
# Trigger the workflow on push or pull request,
|
|
|
|
# but only for the master branch
|
|
|
|
push:
|
|
|
|
paths-ignore:
|
|
|
|
- '**.md'
|
|
|
|
pull_request:
|
|
|
|
paths-ignore:
|
|
|
|
- '**.md'
|
|
|
|
jobs:
|
|
|
|
job_1:
|
|
|
|
name: Build goc binary
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Install Go
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
|
|
|
go-version: 1.14.x
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Go build
|
|
|
|
run: |
|
|
|
|
go build
|
2020-07-10 13:49:10 +00:00
|
|
|
- name: Use goc to build self
|
2020-05-21 06:30:41 +00:00
|
|
|
run: |
|
2020-07-10 13:49:10 +00:00
|
|
|
./goc build --output ./gocc --debug
|
|
|
|
- name: Upload goc binary
|
2020-05-21 06:30:41 +00:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: goc
|
2020-05-21 06:58:40 +00:00
|
|
|
path: goc
|
2020-07-10 13:49:10 +00:00
|
|
|
- name: Upload covered self goc binary
|
2020-05-21 06:30:41 +00:00
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2020-07-10 13:49:10 +00:00
|
|
|
name: gocc
|
|
|
|
path: gocc
|
2020-05-21 06:30:41 +00:00
|
|
|
|
|
|
|
job_2:
|
|
|
|
name: E2E test
|
|
|
|
needs: job_1
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2020-09-11 08:06:35 +00:00
|
|
|
go-version: [1.11.x, 1.12.x, 1.13.x, 1.14.x, 1.15.x]
|
2020-05-21 06:30:41 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Install Go
|
|
|
|
uses: actions/setup-go@v2
|
|
|
|
with:
|
|
|
|
go-version: ${{ matrix.go-version }}
|
|
|
|
- name: Checkout code
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Download built binary
|
|
|
|
uses: actions/download-artifact@v2
|
|
|
|
with:
|
|
|
|
path: /home/runner/tools
|
2020-07-10 13:49:10 +00:00
|
|
|
- name: Install bats-core
|
|
|
|
run: |
|
|
|
|
git clone https://github.com/bats-core/bats-core.git
|
|
|
|
cd bats-core
|
|
|
|
sudo ./install.sh /usr/local
|
2020-05-21 06:30:41 +00:00
|
|
|
- name: Do test
|
2020-07-21 03:49:57 +00:00
|
|
|
env:
|
|
|
|
GOVERSION: ${{ matrix.go-version }}
|
2020-05-21 06:30:41 +00:00
|
|
|
run: |
|
2020-07-10 13:49:10 +00:00
|
|
|
chmod +x /home/runner/tools/goc/goc
|
|
|
|
export PATH=/home/runner/tools/goc:$PATH
|
|
|
|
chmod +x /home/runner/tools/gocc/gocc
|
|
|
|
export PATH=/home/runner/tools/gocc:$PATH
|
2020-05-21 06:30:41 +00:00
|
|
|
cd tests
|
|
|
|
./run-ci-actions.sh
|