-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor filenames and improve process on github actions
- Loading branch information
Showing
3 changed files
with
67 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 != ''" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: | ||
|
@@ -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 | ||
|
@@ -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: | ||
|
@@ -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 | ||
|