Skip to content

Commit

Permalink
switch from travis to actions
Browse files Browse the repository at this point in the history
  • Loading branch information
jsirianni committed Nov 7, 2023
1 parent 9edfbff commit de596e3
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 55 deletions.
93 changes: 93 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: CI
on:
pull_request:
merge_group:
push:
branches:
- main

permissions:
contents: read
# Make sure package write permission is always enabled, even
# for Dependabot pull requests.
packages: write

# Prevent multiple runs on the same branch. This is important for webhooks
# that must be run in order.
concurrency:
group: ${{ github.head_ref || github.ref_name }}
cancel-in-progress: true

jobs:
shellcheck:
runs-on: "ubuntu-22.04"
steps:
- name: Check out source code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Run shellcheck
uses: ludeeus/action-shellcheck@master
with:
version: v0.8.0
scandir: "./scripts"
severity: info

go-test:
runs-on: "ubuntu-22.04"
needs:
- setup-environment
steps:
- name: Check out source code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Go
uses: actions/[email protected]
with:
go-version: "1.21.3"

- run: make test

go-lint:
runs-on: "ubuntu-22.04"
needs:
- setup-environment
steps:
- name: Check out source code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Go
uses: actions/[email protected]
with:
go-version: "1.21.3"

- run: make lint

build:
runs-on: "ubuntu-22.04"
needs:
- setup-environment
steps:
- name: Check out source code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Go
uses: actions/[email protected]
with:
go-version: "1.21.3"

- name: Test GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
version: v1.21.2
args: release --skip=publish --clean --snapshot
distribution: goreleaser
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20 changes: 0 additions & 20 deletions .travis.yml

This file was deleted.

19 changes: 4 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,25 +1,14 @@
VERSION := $(shell cat cmd/root.go | grep 'const version' | cut -c 25- | tr -d '"')

$(shell mkdir -p artifacts)

build: clean
$(info building disk-usage ${VERSION})

@docker build \
-f docker/Dockerfile \
--no-cache \
--build-arg version=${VERSION} \
-t disk-usage:${VERSION} .

@docker create -ti --name disk-usageartifacts disk-usage:${VERSION} bash && \
docker cp disk-usageartifacts:/disk-usage/artifacts/. artifacts/

# cleanup
@docker rm -fv disk-usageartifacts &> /dev/null
goreleaser build --snapshot --clean

lint:
golint ./...

test:
go test ./...

fmt:
go fmt ./...

Expand Down
20 changes: 0 additions & 20 deletions docker/Dockerfile

This file was deleted.

0 comments on commit de596e3

Please sign in to comment.