This commit is contained in:
@@ -13,21 +13,44 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- 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
|
- name: Install Go
|
||||||
run: |
|
run: |
|
||||||
GO_VERSION=$(grep '^go ' backend/go.mod | awk '{print $2}')
|
if [ ! -f /usr/local/go/bin/go ]; then
|
||||||
curl -fsSL https://golang.google.cn/dl/go${GO_VERSION}.linux-amd64.tar.gz -o /tmp/go.tar.gz
|
GO_VERSION=$(grep '^go ' backend/go.mod | awk '{print $2}')
|
||||||
sudo tar -C /usr/local -xzf /tmp/go.tar.gz
|
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
|
echo "/usr/local/go/bin" >> $GITHUB_PATH
|
||||||
|
|
||||||
- name: Go tests
|
- name: Go tests
|
||||||
working-directory: backend
|
working-directory: backend
|
||||||
run: go test ./...
|
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
|
- name: Install Flutter
|
||||||
run: |
|
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
|
if [ ! -f /opt/flutter/bin/flutter ]; then
|
||||||
sudo tar -C /opt -xf /tmp/flutter.tar.xz
|
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
|
echo "/opt/flutter/bin" >> $GITHUB_PATH
|
||||||
env:
|
env:
|
||||||
PUB_HOSTED_URL: https://pub.flutter-io.cn
|
PUB_HOSTED_URL: https://pub.flutter-io.cn
|
||||||
|
|||||||
Reference in New Issue
Block a user