Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add test wf #322

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 4 additions & 26 deletions .github/workflows/go.yml → .github/workflows/go-build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: Go
name: Go Build

on:
workflow_call:
workflow_dispatch:
push:
pull_request:
branches: [ "main" ]
Expand All @@ -12,49 +14,25 @@ jobs:
runs-on: ubuntu-latest
container:
image: ghcr.io/vanilla-os/pico:main

steps:
- uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21

- name: Install build dependencies
run: |
apt-get update
apt-get install -y libbtrfs-dev libdevmapper-dev libgpgme-dev pkg-config build-essential libdpkg-dev

- name: Build
run: go build -o abrootv2

- name: Test
run: go test -v ./tests/...

- name: Check for missing strings
uses: vanilla-os/missing-strings-golang-action@v0.1.0

- name: Compress
run: tar -czvf abrootv2.tar.gz abrootv2

- name: Compress-manpage
run: tar -czvf abroot-man.tar.gz man/man1/abroot.1

- uses: actions/upload-artifact@v4
with:
name: abrootv2
name: abroot
path: |
abrootv2.tar.gz
abroot-man.tar.gz

- uses: softprops/action-gh-release@v2
if: github.repository == 'vanilla-os/ABRoot' && github.ref == 'refs/heads/main'
with:
token: "${{ secrets.GITHUB_TOKEN }}"
tag_name: "continuous"
prerelease: true
name: "Continuous Build"
files: |
abrootv2.tar.gz
abroot-man.tar.gz
39 changes: 39 additions & 0 deletions .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Run Tests

on:
push:
workflow_dispatch:
pull_request:
branches: [ "main" ]

jobs:
go-build:
uses: ./.github/workflows/go-build.yaml
go-tests:
name: Go Test
needs: [go-build]
runs-on: ubuntu-latest
container:
image: ghcr.io/vanilla-os/pico:main
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21
- uses: actions/download-artifact@v3
with:
name: abroot
- name: Untar
run: tar xvf abrootv2.tar.gz
- name: Test
run: go test -v ./tests/...
missing-strings:
name: Missing Strings
runs-on: ubuntu-latest
container:
image: ghcr.io/vanilla-os/pico:main
steps:
- uses: actions/checkout@v4
- name: Check for missing strings
uses: vanilla-os/missing-strings-golang-action@v0.1.0
27 changes: 7 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,22 @@ on:
- '*'

jobs:
go-build:
uses: ./.github/workflows/go-build.yaml
release:
runs-on: ubuntu-latest
container:
image: ghcr.io/vanilla-os/pico:main

steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
- uses: actions/download-artifact@v3
with:
go-version: 1.21

- name: Install build dependencies
run: |
apt-get update
apt-get install -y libbtrfs-dev libdevmapper-dev libgpgme-dev pkg-config build-essential

- name: Build
run: go build -o abrootv2

- name: Compress
run: tar -czvf abrootv2.tar.gz abrootv2

- name: Compress-manpage
run: tar -czvf abroot-man.tar.gz man/man1/abroot.1

name: abroot
- uses: softprops/action-gh-release@v2
if: github.repository == 'vanilla-os/ABRoot' && github.ref == 'refs/heads/main'
with:
token: "${{ secrets.GITHUB_TOKEN }}"
tag_name: ${{ github.event.release.tag_name }}
name: ABRoot-${{ github.event.release.tag_name }}
files: |
abrootv2.tar.gz
abroot-man.tar.gz