mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2025-10-30 01:26:43 +08:00
fix (CI): get rid of PAT in CI
This commit is contained in:
54
.github/workflows/ci.yml
vendored
54
.github/workflows/ci.yml
vendored
@ -10,8 +10,6 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 14.x
|
node-version: 14.x
|
||||||
@ -38,6 +36,8 @@ jobs:
|
|||||||
go-version: 1.19
|
go-version: 1.19
|
||||||
- name: Setup
|
- name: Setup
|
||||||
run: |
|
run: |
|
||||||
|
sudo apt install -y libraw-dev libjpeg-dev libpng-dev libheif-dev libwebp-dev libgif-dev
|
||||||
|
sudo apt install -y build-essential libstdc++6 libomp-dev
|
||||||
mkdir -p ./dist/data/state/config
|
mkdir -p ./dist/data/state/config
|
||||||
cp config/config.json ./dist/data/state/config/
|
cp config/config.json ./dist/data/state/config/
|
||||||
- name: Build
|
- name: Build
|
||||||
@ -51,31 +51,17 @@ jobs:
|
|||||||
- name: Verify
|
- name: Verify
|
||||||
run: timeout 5 ./dist/filestash || code=$?; if [[ $code -ne 124 ]]; then exit $code; fi
|
run: timeout 5 ./dist/filestash || code=$?; if [[ $code -ne 124 ]]; then exit $code; fi
|
||||||
|
|
||||||
test_prepare:
|
test_frontend:
|
||||||
|
needs: [build_frontend, build_backend]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
- name: Clone test repo
|
- name: Clone test repo
|
||||||
env:
|
uses: actions/checkout@v3
|
||||||
PAT: ${{ secrets.PAT }}
|
|
||||||
run: |
|
|
||||||
git clone --depth 1 https://mickael-kerjean:$PAT@github.com/mickael-kerjean/filestash-test test
|
|
||||||
chmod -R 777 ./test/
|
|
||||||
- uses: actions/upload-artifact@master
|
|
||||||
with:
|
with:
|
||||||
name: test
|
repository: mickael-kerjean/filestash-test
|
||||||
path: .
|
ssh-key: ${{ secrets.DEPLOY_KEY_FILESTASH_TEST }}
|
||||||
|
path: test
|
||||||
test_frontend:
|
|
||||||
needs: test_prepare
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Restore
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: test
|
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 14.x
|
node-version: 14.x
|
||||||
@ -90,13 +76,16 @@ jobs:
|
|||||||
npm test
|
npm test
|
||||||
|
|
||||||
test_backend:
|
test_backend:
|
||||||
needs: [test_prepare, build_frontend, build_backend]
|
needs: [build_frontend, build_backend]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Restore
|
- uses: actions/checkout@v3
|
||||||
uses: actions/download-artifact@v3
|
- name: Clone test repo
|
||||||
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
name: test
|
repository: mickael-kerjean/filestash-test
|
||||||
|
ssh-key: ${{ secrets.DEPLOY_KEY_FILESTASH_TEST }}
|
||||||
|
path: test
|
||||||
- uses: actions/download-artifact@v3
|
- uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: build-frontend
|
name: build-frontend
|
||||||
@ -138,7 +127,7 @@ jobs:
|
|||||||
cat access.log | grep -vz "ERR"
|
cat access.log | grep -vz "ERR"
|
||||||
|
|
||||||
test_e2e:
|
test_e2e:
|
||||||
needs: [test_smoke, test_prepare]
|
needs: [test_smoke]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: machines/puppeteer
|
image: machines/puppeteer
|
||||||
@ -148,14 +137,17 @@ jobs:
|
|||||||
APP_URL: http://127.0.0.1:8334
|
APP_URL: http://127.0.0.1:8334
|
||||||
CI: true
|
CI: true
|
||||||
steps:
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Clone test repo
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
repository: mickael-kerjean/filestash-test
|
||||||
|
ssh-key: ${{ secrets.DEPLOY_KEY_FILESTASH_TEST }}
|
||||||
|
path: test
|
||||||
- name: Restore Build
|
- name: Restore Build
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: build
|
name: build
|
||||||
- name: Restore Project
|
|
||||||
uses: actions/download-artifact@v3
|
|
||||||
with:
|
|
||||||
name: test
|
|
||||||
- name: Setup
|
- name: Setup
|
||||||
run: |
|
run: |
|
||||||
cd ./test/e2e
|
cd ./test/e2e
|
||||||
|
|||||||
10
Makefile
10
Makefile
@ -1,7 +1,7 @@
|
|||||||
all:
|
all:
|
||||||
make build_init
|
make build_init
|
||||||
make build_frontend
|
make build_frontend
|
||||||
GOARCH=amd64 GOOS=linux make build_backend
|
make build_backend
|
||||||
|
|
||||||
build_init:
|
build_init:
|
||||||
go generate -x ./server/...
|
go generate -x ./server/...
|
||||||
@ -10,7 +10,13 @@ build_frontend:
|
|||||||
NODE_ENV=production npm run build
|
NODE_ENV=production npm run build
|
||||||
|
|
||||||
build_backend:
|
build_backend:
|
||||||
CGO_ENABLED=0 go build -ldflags="-extldflags=-static" -mod=vendor --tags "fts5" -o dist/filestash cmd/main.go
|
CGO_ENABLED=1 go build -mod=vendor --tags "fts5" -o dist/filestash cmd/main.go
|
||||||
|
|
||||||
|
build_backend_arm64:
|
||||||
|
CGO_ENABLED=1 GOOS=linux GOARCH=arm GOARM=7 CC=arm-linux-gnueabihf-gcc go build -o dist/filestash cmd/main.go
|
||||||
|
|
||||||
|
build_backend_amd64:
|
||||||
|
GOOS=linux CGO_ENABLED=1 GOARCH=amd64 CC=gcc go build -o dist/filestash cmd/main.go
|
||||||
|
|
||||||
clean_frontend:
|
clean_frontend:
|
||||||
rm -rf server/ctrl/static/www/
|
rm -rf server/ctrl/static/www/
|
||||||
|
|||||||
Reference in New Issue
Block a user