use cache #139
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: basebuild | |
on: | |
pull_request: | |
push: | |
jobs: | |
goreleaser: | |
runs-on: ${{ matrix.runners }} | |
strategy: | |
fail-fast: true | |
matrix: | |
runners: | |
- "warpdev-ubuntu-2404-x64-2x" | |
- "warpdev-ubuntu-2404-x64-4x" | |
- "warpdev-ubuntu-2404-x64-8x" | |
- "warpdev-ubuntu-2404-x64-16x" | |
- "warpdev-ubuntu-2404-x64-32x" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Log GitHub context | |
uses: actions/github-script@v7 | |
with: | |
script: | | |
console.log('GitHub context:', context); | |
core.debug('Full GitHub context object:'); | |
core.debug(JSON.stringify(context, null, 2)); | |
- name: Set up Node.js | |
uses: WarpBuilds/setup-node@v4 | |
with: | |
node-version: 20.11.0 | |
- name: Cache Node.js modules | |
uses: actions/cache@v3 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-node- | |
- name: Ensure GCC is installed | |
run: | | |
if ! command -v gcc &> /dev/null | |
then | |
echo "GCC could not be found, installing..." | |
sudo apt-get update | |
sudo apt-get install -y gcc | |
else | |
echo "GCC is already installed" | |
fi | |
- name: Set up Go | |
uses: WarpBuilds/setup-go@v5 | |
with: | |
go-version: '>=1.22.5' | |
- name: Cache Go modules | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/go-build | |
~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Build Admin dashboard UI | |
run: npm --prefix=./ui ci && npm --prefix=./ui run build | |
- name: Run tests | |
run: go test ./... | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v3 | |
with: | |
distribution: goreleaser | |
version: latest | |
args: release --clean | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |