Skip to content

Commit

Permalink
Add GitHub action to check build
Browse files Browse the repository at this point in the history
  • Loading branch information
camilamacedo86 committed Sep 24, 2023
1 parent fe1bcc4 commit c0ccc09
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Test Build

on:
push:
pull_request:

jobs:
build-binaries:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Build Container
run: |
make container-init
- name: Run Container to Build Binaries
run: |
docker run --rm -v $(pwd):/fioctl fioctl-build sh -c "git config --global --add safe.directory /fioctl && make build"
- name: Archive Binaries
uses: actions/upload-artifact@v2
with:
name: binaries
path: bin/

test:
needs: build-binaries
strategy:
matrix:
include:
- os: ubuntu-latest
binary: fioctl-linux-amd64
- os: windows-latest
binary: fioctl-windows-amd64.exe
- os: macos-latest
binary: fioctl-darwin-amd64
runs-on: ${{ matrix.os }}
steps:
- name: Download Binaries
uses: actions/download-artifact@v2
with:
name: binaries
path: bin/

- name: Set Execute Permission
run: chmod +x ./bin/${{ matrix.binary }}
if: runner.os != 'Windows'

- name: Test Binary
run: ./bin/${{ matrix.binary }} logout

0 comments on commit c0ccc09

Please sign in to comment.