add ci #20
Workflow file for this run
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: π CI | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
workflow_dispatch: | |
# Cancel in-progress runs of this workflow. | |
# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-only-cancel-in-progress-jobs-or-runs-for-the-current-workflow | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
RW_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
jobs: | |
ci: | |
name: π CI | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: '1.21' | |
cache-dependency-path: ./cli/go.sum | |
- run: make smoke-test | |
- name: Errors if the node version is too low | |
run: | | |
# Disable immediate exit on error | |
set +e | |
./rw create ${{ runner.temp }}/rw-test-node-version-unmet | |
result=$? | |
set -e | |
if [ $result -eq 0 ]; then | |
echo "Command succeeded when it was expected to fail." | |
exit 1 | |
else | |
echo "Command failed as expected." | |
exit 0 | |
fi | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 21 | |
- name: Allows node versions >= 20 | |
run: | | |
./rw create ${{ runner.temp }}/rw-test-node-version-met | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Doesn't require git config | |
run: ./rw create ${{ runner.temp }}/rw-test-no-git-config | |
- name: Works with git config | |
run: | | |
git config --global user.email "test@example.com" | |
git config --global user.name "test" | |
./rw create ${{ runner.temp }}/rw-test-git-config | |
- name: Errors if yarn is not used via corepack | |
run: | | |
TARGET_DIR="${{ runner.temp }}/rw-test" | |
./rw create $TARGET_DIR | |
- name: Errors if not all yarns are via corepack | |
run: | | |
corepack enable | |
TARGET_DIR="${{ runner.temp }}/rw-test" | |
./rw create $TARGET_DIR | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: logs | |
path: ~/.rw/debug.json |