Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix (CI): broken step #648

Closed
wants to merge 13 commits into from
62 changes: 36 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ jobs:
run: npm install
- name: Build
run: make build_frontend
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v4
with:
name: build-frontend
path: server/ctrl/static/www/

build_backend:
needs: build_frontend
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@master
- uses: actions/download-artifact@v4
with:
name: build-frontend
path: server/ctrl/static/www/
Expand All @@ -44,16 +44,16 @@ jobs:
run: |
make build_init
make build_backend
- uses: actions/upload-artifact@master
- uses: actions/upload-artifact@v4
with:
name: build
path: dist
- name: Verify
run: timeout 5 ./dist/filestash || code=$?; if [[ $code -ne 124 ]]; then exit $code; fi

test_frontend:
needs: [build_frontend, build_backend]
test_prepare:
runs-on: ubuntu-latest
needs: [build_frontend, build_backend]
steps:
- uses: actions/checkout@v3
- name: Clone test repo
Expand All @@ -62,6 +62,20 @@ jobs:
repository: mickael-kerjean/filestash-test
ssh-key: ${{ secrets.DEPLOY_KEY_FILESTASH_TEST }}
path: test
- uses: actions/upload-artifact@v4
with:
name: test
path: test

test_frontend:
needs: test_prepare
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v4
with:
name: test
path: test
- uses: actions/setup-node@v3
with:
node-version: 14.x
Expand Down Expand Up @@ -92,17 +106,15 @@ jobs:
# npx tsc

test_backend:
needs: [build_frontend, build_backend]
needs: test_prepare
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Clone test repo
uses: actions/checkout@v3
- uses: actions/download-artifact@v4
with:
repository: mickael-kerjean/filestash-test
ssh-key: ${{ secrets.DEPLOY_KEY_FILESTASH_TEST }}
name: test
path: test
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: build-frontend
path: server/ctrl/static/www/
Expand All @@ -112,6 +124,8 @@ jobs:
- name: Setup
run: |
sudo apt-get install -y poppler-utils
ls -lah
ls -lah test
cp ./test/assets/* /tmp/
mkdir server/ctrl/static/www/ && touch server/ctrl/static/www/index.html
make build_init
Expand All @@ -123,11 +137,11 @@ jobs:
run: go test --tags "fts5" -count=1 $(go list ./server/... | grep -v "server/plugin" | grep -v "server/generator")

test_smoke:
needs: [build_frontend, build_backend]
needs: test_prepare
runs-on: ubuntu-latest
steps:
- name: Init
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: build
- name: Run
Expand All @@ -143,7 +157,7 @@ jobs:
cat access.log | grep -vz "ERR"

# test_e2e:
# needs: [test_smoke]
# needs: test_smoke
# runs-on: ubuntu-latest
# container:
# image: machines/puppeteer
Expand All @@ -153,15 +167,11 @@ jobs:
# APP_URL: http://127.0.0.1:8334
# CI: true
# steps:
# - uses: actions/checkout@v3
# - name: Clone test repo
# uses: actions/checkout@v3
# - uses: actions/checkout@v4
# - uses: actions/download-artifact@v4
# with:
# repository: mickael-kerjean/filestash-test
# ssh-key: ${{ secrets.DEPLOY_KEY_FILESTASH_TEST }}
# path: test
# - name: Restore Build
# uses: actions/download-artifact@v3
# name: test
# - uses: actions/download-artifact@v4
# with:
# name: build
# - name: Setup
Expand All @@ -177,8 +187,8 @@ jobs:
# npm test

release_docker_amd64:
# if: github.ref == 'refs/heads/master'
needs: [ test_backend, test_frontend, test_smoke ]
if: github.ref == 'refs/heads/master'
needs: [ test_backend, test_frontend, test_e2e ]
runs-on: ubuntu-latest
steps:
- name: Init
Expand All @@ -195,7 +205,7 @@ jobs:

release_docker_arm64:
if: github.ref == 'refs/heads/master'
needs: [ test_backend, test_frontend, test_smoke ]
needs: [ test_backend, test_frontend, test_e2e ]
runs-on: ubuntu-latest
steps:
- name: Init
Expand Down