Skip to content

ci

ci #1631

Workflow file for this run

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",
]
include:
- ci_step: "lint"
command: "crust lint"
linter-cache: true
- ci_step: "test"
command: "crust test"
linter-cache: false
runs-on: ubuntu-22.04
steps:
- name: Go version used to build builder
run: go version
- name: Checkout crust
uses: actions/checkout@v4
with:
persist-credentials: false
path: crust
- name: Set up build system
run: |
echo "$(pwd)/crust/bin" >> $GITHUB_PATH
crust/bin/crust build/me
- name: Retrieve go version
id: goversion
run: echo "GO_VERSION=$(go version)" >> $GITHUB_OUTPUT
- name: Print go version
run: echo ${{ steps.goversion.outputs.GO_VERSION }}
- name: Setup go cache
uses: actions/cache@v4
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: Run ${{ matrix.ci_step }}
run: ${{ matrix.command }}