ci #410
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
name: ci | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
schedule: | |
- cron: '0 1 * * 1' # At 01:00 on Monday | |
workflow_dispatch: | |
jobs: | |
ci: | |
strategy: | |
fail-fast: false | |
matrix: | |
ci_step: [ | |
"lint", | |
"test", | |
"integration tests", | |
] | |
include: | |
- ci_step: "lint" | |
command: "faucet-builder lint" | |
go-cache: true | |
linter-cache: true | |
docker-cache: false | |
- ci_step: "test" | |
command: "faucet-builder test" | |
go-cache: true | |
linter-cache: false | |
docker-cache: false | |
- ci_step: "integration tests" | |
command: | | |
faucet-builder images | |
coreum-builder build images | |
crust znet start --profiles=faucet --timeout-commit 0.5s | |
faucet-builder integration-tests | |
crust znet stop | |
crust znet coverage-convert | |
go-cache: true | |
linter-cache: false | |
docker-cache: true | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Go version used to build builder | |
run: go version | |
- name: Checkout faucet | |
uses: actions/checkout@v4 | |
with: | |
persist-credentials: false | |
path: faucet | |
- name: Checkout coreum | |
uses: actions/checkout@v4 | |
with: | |
repository: CoreumFoundation/coreum | |
path: coreum | |
- name: Checkout crust | |
uses: actions/checkout@v4 | |
with: | |
repository: CoreumFoundation/crust | |
path: crust | |
- name: Set up build system | |
run: | | |
echo "$(pwd)/faucet/bin" >> $GITHUB_PATH | |
echo "$(pwd)/coreum/bin" >> $GITHUB_PATH | |
echo "$(pwd)/crust/bin" >> $GITHUB_PATH | |
faucet/bin/faucet-builder build/me | |
- name: Retrieve go version | |
id: goversion | |
run: echo "GO_VERSION=$(faucet/bin/go version)" >> $GITHUB_OUTPUT | |
- name: Print go version | |
run: echo ${{ steps.goversion.outputs.GO_VERSION }} | |
- name: Setup go cache | |
uses: actions/cache@v4 | |
if: ${{ matrix.go-cache }} | |
with: | |
path: | | |
~/.cache/go-build | |
~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}-${{ steps.goversion.outputs.GO_VERSION }} | |
- name: Setup linter cache | |
uses: actions/cache@v4 | |
if: ${{ matrix.linter-cache }} | |
with: | |
path: ~/.cache/golangci-lint | |
key: ${{ runner.os }}-linter-cache-${{ steps.goversion.outputs.GO_VERSION }} | |
- name: Get Date | |
id: get-year-week | |
run: | | |
echo "date=$(/bin/date -u "+%Y-%U")" >> $GITHUB_OUTPUT | |
shell: bash | |
- name: Set docker cache | |
uses: ScribeMD/docker-cache@0.5.0 | |
if: ${{ matrix.docker-cache }} | |
with: | |
key: ${{ runner.os }}-docker-cache-scribemd-${{ steps.get-year-week.outputs.date }} # year-week key | |
- name: Prepare dependencies | |
# FIXME (wojciech): Execute `download` commands for crust and coreum builders once available | |
run: | | |
crust build/me | |
crust build | |
crust znet remove | |
coreum-builder build/me | |
faucet-builder build/me | |
faucet-builder download | |
- name: Run ${{ matrix.ci_step }} | |
run: ${{ matrix.command }} | |
- name: Dump docker logs on failure | |
if: failure() | |
uses: jwalton/gh-docker-logs@v2 |