diff --git a/.github/workflows/test.yml b/.github/workflows/ci.yml similarity index 59% rename from .github/workflows/test.yml rename to .github/workflows/ci.yml index 90d42cd..276c1d7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Test +name: 'CI/CD Pipeline' on: [push] @@ -6,6 +6,31 @@ jobs: test: runs-on: ubuntu-latest + strategy: + matrix: + node-version: ['10', '12', '13'] + + steps: + - uses: actions/checkout@v1 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + + - name: Cache node modules + uses: actions/cache@v1 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: ${{ runner.os }}-node-${{ matrix.node-version }}- + + - run: npm ci + - run: npm test + + build: + runs-on: ubuntu-latest + strategy: matrix: node-version: ['10', '12', '13'] @@ -32,8 +57,6 @@ jobs: key: ${{ runner.os }}-${{ matrix.node-version }}-public - run: npm ci - - run: npm test - run: npm run build env: - CI: true GATSBY_GITHUB_TOKEN: ${{ secrets.GATSBY_GITHUB_TOKEN }}