Update build.yml #1021
This file contains 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: build | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
environment: test | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "^18.4.0" | |
cache: "npm" | |
- name: Install dependencies | |
run: npm ci | |
- run: npm run lint | |
- run: npm run prettier -- --check | |
- name: Create .env file and Sets variables to unit tests | |
env: | |
ACCESS_TOKEN: ${{ secrets.VITE_ACCESS_TOKEN }} | |
OAUTH_TOKEN: ${{ secrets.VITE_OAUTH_TOKEN }} | |
SPACE_ID: ${{ vars.VITE_SPACE_ID }} | |
run: | | |
echo VITE_ACCESS_TOKEN="$ACCESS_TOKEN" >> ~/.env.test | |
echo VITE_OAUTH_TOKEN="$OAUTH_TOKEN" >> ~/.env.test | |
echo VITE_SPACE_ID="$SPACE_ID" >> ~/.env.test | |
echo "cat .env.test" | |
cat ~/.env.test | |
echo "ls -a ." | |
ls -a ~/. | |
echo "ls -a ${{ github.workspace }}" | |
ls -a ${{ github.workspace }} | |
shell: bash | |
- run: npm run test | |
- run: npm run build |