From c0d24aa1e1c63cb0436a0243eec62512e0005e1e Mon Sep 17 00:00:00 2001 From: Rong Sen Ng Date: Sat, 21 Mar 2020 13:52:51 +0800 Subject: [PATCH] ci: Trying to use Github Actions --- .circleci/config.yml | 22 ++++--- .github/workflows/ci.yml | 128 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 143 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/ci.yml diff --git a/.circleci/config.yml b/.circleci/config.yml index 356d8388..78d09e59 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -54,6 +54,13 @@ jobs: paths: - "*" + success: + steps: + - run: + name: Success + command: | + echo "Success" + test_local: <<: *defaults steps: @@ -84,10 +91,11 @@ workflows: version: 2 multi-build-n-test: jobs: - - build - - test_local: - requires: - - build - - test_sauce_labs: - requires: - - build + - success + # - build + # - test_local: + # requires: + # - build + # - test_sauce_labs: + # requires: + # - build diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..bb423a9f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,128 @@ +name: ci + +on: + - push + - pull_request + +jobs: + build: + name: Build ${{ matrix.os }} ${{ matrix.target }} + runs-on: ${{ matrix.os }} + timeout-minutes: 120 + strategy: + matrix: + os: [macos-latest, ubuntu-18.04, windows-2019] + node-version: [13.x] + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install global dependencies + run: | + npm i -g npm@latest --quiet + + - name: Install dependencies + run: | + npm ci --quiet + + - name: Lint + run: | + npm run lint + + - name: Build + run: | + npm run build:test && npm run build:config + + - name: Check build + run: | + pwd && ls -la + + - name: Upload build artifact + uses: actions/upload-artifact@v1 + with: + name: build-${{ matrix.os }}-${{ matrix.target }} + path: dist + + test: + name: Test ${{ matrix.os }} ${{ matrix.target }} + needs: build + runs-on: ${{ matrix.os }} + timeout-minutes: 120 + strategy: + matrix: + os: [macos-latest, ubuntu-18.04, windows-2019] + node-version: [13.x] + + steps: + - name: Download build artifact + uses: actions/download-artifact@v1 + with: + name: build-${{ matrix.os }}-${{ matrix.target }} + - name: List versions + run: | + pwd && ls -la && node -v && npm -v && which npm + - name: Install dependencies + run: | + npm ci --quiet + - name: Run Test + run: | + npm run test:dev + + # test: + # name: ${{ matrix.os }} ${{ matrix.target }} + # runs-on: ${{ matrix.os }} + # timeout-minutes: 120 + # strategy: + # matrix: + + # include: + # - os: macos-latest + # target: x86_64-apple-darwin + # - os: ubuntu-18.04 + # target: x86_64-unknown-linux-gnu + # - os: windows-2019 + # target: x86_64-pc-windows-msvc + + # steps: + # - name: Config git + # run: git config --global core.symlinks true + + # - name: Checkout + # uses: actions/checkout@v2 + + # - name: Cache cargo registry + # uses: actions/cache@v1 + # with: + # path: ~/.cargo/registry + # key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} + + # - name: Cache cargo index + # uses: actions/cache@v1 + # with: + # path: ~/.cargo/git + # key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} + + # - name: Cache cargo build + # uses: actions/cache@v1 + # with: + # path: target + # key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} + + # - name: List versions + # run: | + # pwd && cargo -V && rustc -V + # - name: Run cargo check + # run: | + # cargo check + # - name: Run cargo fmt + # run: | + # cargo fmt --all -- --check + # - name: Run cargo clippy + # run: | + # cargo clippy --all-targets --locked --target ${{ matrix.target }} -- -D clippy::all + # # cargo clippy --all-targets --locked --target ${{ matrix.target }} + + # - name: Run cargo test + # run: | + # cargo test -vv --all-targets --locked --target ${{ matrix.target }}