This commit is contained in:
@@ -13,21 +13,44 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Cache Go SDK + modules
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
/usr/local/go
|
||||
~/go/pkg/mod
|
||||
~/.cache/go-build
|
||||
key: go-${{ hashFiles('backend/go.mod') }}
|
||||
restore-keys: go-
|
||||
|
||||
- name: Install Go
|
||||
run: |
|
||||
GO_VERSION=$(grep '^go ' backend/go.mod | awk '{print $2}')
|
||||
curl -fsSL https://golang.google.cn/dl/go${GO_VERSION}.linux-amd64.tar.gz -o /tmp/go.tar.gz
|
||||
sudo tar -C /usr/local -xzf /tmp/go.tar.gz
|
||||
if [ ! -f /usr/local/go/bin/go ]; then
|
||||
GO_VERSION=$(grep '^go ' backend/go.mod | awk '{print $2}')
|
||||
curl -fsSL https://golang.google.cn/dl/go${GO_VERSION}.linux-amd64.tar.gz -o /tmp/go.tar.gz
|
||||
sudo tar -C /usr/local -xzf /tmp/go.tar.gz
|
||||
fi
|
||||
echo "/usr/local/go/bin" >> $GITHUB_PATH
|
||||
|
||||
- name: Go tests
|
||||
working-directory: backend
|
||||
run: go test ./...
|
||||
|
||||
- name: Cache Flutter SDK + pub
|
||||
uses: actions/cache@v3
|
||||
with:
|
||||
path: |
|
||||
/opt/flutter
|
||||
~/.pub-cache
|
||||
key: flutter-3.41.6-${{ hashFiles('client/pubspec.lock') }}
|
||||
restore-keys: flutter-3.41.6-
|
||||
|
||||
- name: Install Flutter
|
||||
run: |
|
||||
curl -fsSL https://storage.flutter-io.cn/flutter_infra_release/releases/stable/linux/flutter_linux_3.41.6-stable.tar.xz -o /tmp/flutter.tar.xz
|
||||
sudo tar -C /opt -xf /tmp/flutter.tar.xz
|
||||
if [ ! -f /opt/flutter/bin/flutter ]; then
|
||||
curl -fsSL https://storage.flutter-io.cn/flutter_infra_release/releases/stable/linux/flutter_linux_3.41.6-stable.tar.xz -o /tmp/flutter.tar.xz
|
||||
sudo tar -C /opt -xf /tmp/flutter.tar.xz
|
||||
fi
|
||||
echo "/opt/flutter/bin" >> $GITHUB_PATH
|
||||
env:
|
||||
PUB_HOSTED_URL: https://pub.flutter-io.cn
|
||||
|
||||
Reference in New Issue
Block a user