Created
March 1, 2020 17:51
-
-
Save leon/29350ce4734b955cee924586705ea875 to your computer and use it in GitHub Desktop.
Nrwl NX github actions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test develop and feature branches | |
on: | |
push: | |
branches: | |
- develop | |
- "feature/*" | |
jobs: | |
test: | |
name: Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- name: Use node.js 12 | |
uses: actions/setup-node@v1 | |
with: | |
node-version: 12 | |
- name: Cache Yarn | |
uses: actions/cache@v1 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} | |
restore-keys: | | |
${{ runner.OS }}-yarn-${{ env.cache-name }}- | |
${{ runner.os }}-yarn- | |
- name: Yarn install | |
run: yarn install --frozen-lockfile --non-interactive | |
- name: Retreive last test sha | |
id: last-test-sha | |
run: | | |
if [[ $GITHUB_BASE_REF ]] | |
then | |
echo "::set-output name=sha::remotes/origin/$GITHUB_BASE_REF" | |
else | |
echo "::set-output name=sha::$(git rev-parse HEAD~1)" | |
fi | |
- name: Run affected tests | |
run: yarn affected:test --ci --runInBand --base=${{ steps.last-test-sha.outputs.sha }} --head=${GITHUB_SHA} | |
env: | |
CI: "true" | |
TZ: "utc" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment