Skip to content

Ci improvements

Ci improvements #244

Workflow file for this run

name: Test
on:
push:
branches-ignore: [ main ]
pull_request:
branches: [ main ]
env:
GITHUB_TOKEN: ${{ github.token }}
LINT_VERSION: "1.53.3"
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
check-latest: true
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Go Tests
run: |
go get && go test ./...
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v3
with:
args: -v
compile:
name: Compile
runs-on: ubuntu-latest
needs: [test]
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
check-latest: true
id: go
- name: cli-test
run: |
go test -coverprofile=go.txt -v ./...
go run main.go
go run main.go version
go run main.go events
go run main.go events -f volcanoes,wildfires
go run main.go events -f volcanoes,wildfires -o table
go run main.go events -f volcanoes,wildfires -o json
go run main.go events -o table
go run main.go events -d
go run main.go events -o json
- name: build & execute
run: |
echo "--------------------------------------------------"
go build -ldflags="-X 'github.com/karl-cardenas-coding/disaster-cli/cmd.VersionString=$345.0.0'" -o=disaster -v
./disaster events -d
./disaster events -o table
./disaster events -o json
./disaster version
./disaster events -f volcanoes,wildfires
./disaster events -f volcanoes,wildfires -o table
./disaster events -f volcanoes,wildfires -o json
- name: build & verfy update feature
run: |
go build -ldflags="-X 'github.com/karl-cardenas-coding/disaster-cli/cmd.VersionString=1.0.0'" -o=disaster -v
./disaster version
mkdir tempbin
echo 'Y' | ./disaster update -l ./tempbin/
sleep 5
chmod +x disaster
./disaster version
- uses: actions/upload-artifact@v3
with:
name: test-results
path: go.txt
retention-days: 1