From 0a93d69a8e908a4282c3cacbf57585f41040d0c9 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Tue, 6 Oct 2020 16:22:07 +0200 Subject: [PATCH] feat(ci): basic github action --- .github/workflows/ci.yml | 63 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..6ee1b5fe4 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,63 @@ +name: ci +on: [push, pull_request] + +env: + XDG_CACHE_HOME: ${{ github.workspace }}/.cache + +jobs: + + test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [macos-latest, ubuntu-latest, windows-latest] + + steps: + - name: Check out Git repository + uses: actions/checkout@v1 + + - name: Install Node.js + uses: actions/setup-node@v1 + with: + node-version: 12.x + + - name: Cache bigger downloads + uses: actions/cache@v2 + id: cache + with: + path: ${{ github.workspace }}/.cache + key: ${{ runner.os }}-${{ hashFiles('package*json', '*config.js') }} + restore-keys: | + ${{ runner.os }}-${{ hashFiles('package*json', '*config.js') }} + ${{ runner.os }}- + + - name: Install dependencies + run: npm run ci:install # TODO npm ci --prefer-offline --no-audit --progress=false --cache ${{ github.workspace }}/.cache/npm + + - name: Build + run: npm run build + + - name: Show build/ + run: du -sh build/ && ls -l build/ + + - name: Test + run: npm run test + + - name: Lint + run: npm run lint + + # Persist produced binaries and effective config used for building them + # - this is not for releases, but for quick testing during the dev + # - action artifacts can be downloaded for 90 days, then are removed by github + # - binaries in PRs from forks won't be signed + - name: Attach produced packages to Github Action + uses: actions/upload-artifact@v2 + with: + name: build-${{ matrix.os }} + path: build/ipfs_companion*.* + if-no-files-found: error + + - name: Show Cache + run: du -sh ${{ github.workspace }}/.cache/ && ls -l ${{ github.workspace }}/.cache/ +