Skip to content

Commit

Permalink
Refactor filenames and improve process on github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
tnasu committed Feb 25, 2022
1 parent 8a61b27 commit 76cd8da
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 45 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml → .github/workflows/abci.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Tests
# Tests runs different tests (test_abci_apps, test_abci_cli, test_apps)
# This workflow runs on every push to master or release branch and every pull requests
# Test runs different tests (test_abci_apps, test_abci_cli, test_apps)
# This workflow runs on every push to main or release branch and every pull requests
# All jobs will pass without running if no *{.go, .mod, .sum} files have been modified
on:
pull_request:
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build for Linux
on:
pull_request:
push:

jobs:

build-linux:
name: Build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- goarch: "amd64"
gcc: "gcc"
package: ""
host: ""
- goarch: "arm64"
gcc: "aarch64-linux-gnu-gcc"
package: "g++-aarch64-linux-gnu"
host: "aarch64-linux-gnu"
- goarch: "arm"
gcc: "arm-linux-gnueabi-gcc"
package: "g++-arm-linux-gnueabi"
host: "arm-linux-gnueabi"
timeout-minutes: 5
steps:
- run: sudo apt update && sudo apt install -y ${{ matrix.package }} qemu-user-binfmt
if: "matrix.package != ''"
- uses: actions/setup-go@v2
with:
go-version: "^1.15.4"
- uses: actions/[email protected]
- uses: technote-space/[email protected]
with:
PATTERNS: |
**/**.go
go.mod
go.sum
- name: Build Linux
run: GOOS=linux GOARCH=${{ matrix.goarch }} CC=${{ matrix.gcc }} TARGET_HOST=${{ matrix.host }} make build
if: "env.GIT_DIFF != ''"
- name: Build Linux with Libsodium
run: GOOS=linux GOARCH=${{ matrix.goarch }} CC=${{ matrix.gcc }} TARGET_HOST=${{ matrix.host }} LIBSODIUM=1 make build
if: "env.GIT_DIFF != ''"
62 changes: 19 additions & 43 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ jobs:
- uses: actions/[email protected]
- name: Create a file with all the pkgs
run: go list ./... > pkgs.txt
- name: Split pkgs into 4 files
run: split -d -n l/4 pkgs.txt pkgs.txt.part.
- name: Split pkgs into 6 files
run: split -d -n l/6 pkgs.txt pkgs.txt.part.
# cache multiple
- uses: actions/upload-artifact@v2
with:
Expand All @@ -29,6 +29,14 @@ jobs:
with:
name: "${{ github.sha }}-03"
path: ./pkgs.txt.part.03
- uses: actions/upload-artifact@v2
with:
name: "${{ github.sha }}-04"
path: ./pkgs.txt.part.04
- uses: actions/upload-artifact@v2
with:
name: "${{ github.sha }}-05"
path: ./pkgs.txt.part.05

build-libsodium:
name: Build libsodium
Expand All @@ -42,54 +50,14 @@ jobs:
name: libsodium
path: crypto/vrf/internal/vrf/sodium

build-linux:
name: Build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- goarch: "amd64"
gcc: "gcc"
package: ""
host: ""
- goarch: "arm64"
gcc: "aarch64-linux-gnu-gcc"
package: "g++-aarch64-linux-gnu"
host: "aarch64-linux-gnu"
- goarch: "arm"
gcc: "arm-linux-gnueabi-gcc"
package: "g++-arm-linux-gnueabi"
host: "arm-linux-gnueabi"
timeout-minutes: 5
steps:
- run: sudo apt update && sudo apt install -y ${{ matrix.package }} qemu-user-binfmt
if: "matrix.package != ''"
- uses: actions/setup-go@v2
with:
go-version: "^1.15.4"
- uses: actions/[email protected]
- uses: technote-space/[email protected]
with:
PATTERNS: |
**/**.go
go.mod
go.sum
- name: Build Linux
run: GOOS=linux GOARCH=${{ matrix.goarch }} CC=${{ matrix.gcc }} TARGET_HOST=${{ matrix.host }} make build
if: "env.GIT_DIFF != ''"
- name: Build Linux with Libsodium
run: GOOS=linux GOARCH=${{ matrix.goarch }} CC=${{ matrix.gcc }} TARGET_HOST=${{ matrix.host }} LIBSODIUM=1 make build
if: "env.GIT_DIFF != ''"

tests:
runs-on: ubuntu-latest
needs: build-libsodium
strategy:
fail-fast: false
matrix:
vrf: ["r2ishiguro", "libsodium"]
part: ["00", "01", "02", "03"]
part: ["00", "01", "02", "03", "04", "05"]
steps:
- uses: actions/setup-go@v2
with:
Expand Down Expand Up @@ -145,6 +113,14 @@ jobs:
with:
name: "${{ github.sha }}-03-coverage"
if: env.GIT_DIFF
- uses: actions/download-artifact@v2
with:
name: "${{ github.sha }}-04-coverage"
if: env.GIT_DIFF
- uses: actions/download-artifact@v2
with:
name: "${{ github.sha }}-05-coverage"
if: env.GIT_DIFF
- run: |
cat ./*profile.out | grep -v "mode: atomic" >> coverage.txt
if: env.GIT_DIFF
Expand Down

0 comments on commit 76cd8da

Please sign in to comment.