-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* use gh's temp dir * upload logs * respond to push only on main * use gh token env var * update cache dep path * don't make git error fatal * change emoji * git config test * fix syntax error * start on golden path test case * check node version * add test for node * fix syntax * yarn source check * try run yarn * fix command usage * add multiple yarns test * try organizing tests * build before running tests * try moving yarn bin * debug log the exec env and add mv to ci * try upgrading direct deps * try removing patch version * use version file over version * correctly order go action and build * add needs * expect failures --------- Co-authored-by: Dominic Saadi <[email protected]> Co-authored-by: Josh GM Walker <[email protected]>
- Loading branch information
1 parent
990bcc1
commit 560a094
Showing
4 changed files
with
218 additions
and
43 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ name: 🔄 CI | |
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
workflow_dispatch: | ||
|
||
# Cancel in-progress runs of this workflow. | ||
|
@@ -11,18 +12,162 @@ concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
RW_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
jobs: | ||
ci: | ||
name: 🔄 CI | ||
go: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.21' | ||
go-version-file: ./cli/go.mod | ||
cache-dependency-path: ./cli/go.sum | ||
|
||
- run: make smoke-test | ||
|
||
- run: ./rw create $TMPDIR/rw-test | ||
git: | ||
runs-on: ubuntu-latest | ||
needs: go | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: ./cli/go.mod | ||
cache-dependency-path: ./cli/go.sum | ||
|
||
- run: make build | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- run: corepack enable | ||
|
||
- name: Move runners default yarn bin | ||
run: mv /usr/local/bin/yarn /usr/local/bin/yarn-moved | ||
|
||
- 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 "[email protected]" | ||
git config --global user.name "test" | ||
./rw create ${{ runner.temp }}/rw-test-git-config | ||
- uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: git-logs | ||
path: ~/.rw/debug.json | ||
|
||
node: | ||
runs-on: ubuntu-latest | ||
needs: go | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: ./cli/go.mod | ||
cache-dependency-path: ./cli/go.sum | ||
|
||
- run: make build | ||
|
||
- 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 | ||
- run: corepack enable | ||
|
||
- name: Move runners default yarn bin | ||
run: mv /usr/local/bin/yarn /usr/local/bin/yarn-moved | ||
|
||
- name: Allows node versions >= 20 | ||
run: | | ||
./rw create ${{ runner.temp }}/rw-test-node-version-met | ||
- uses: actions/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: node-logs | ||
path: ~/.rw/debug.json | ||
|
||
yarn: | ||
runs-on: ubuntu-latest | ||
needs: go | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version-file: ./cli/go.mod | ||
cache-dependency-path: ./cli/go.sum | ||
|
||
- run: make build | ||
|
||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Errors if yarn is not used via corepack | ||
run: | | ||
# Disable immediate exit on error | ||
set +e | ||
./rw create ${{ runner.temp }}/rw-test-yarn-not-corepack | ||
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 | ||
- name: Errors if not all yarns are via corepack | ||
run: | | ||
corepack enable | ||
# Disable immediate exit on error | ||
set +e | ||
./rw create ${{ runner.temp }}/rw-test-yarn-not-all-corepack | ||
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/upload-artifact@v4 | ||
if: always() | ||
with: | ||
name: yarn-logs | ||
path: ~/.rw/debug.json |
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
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
Oops, something went wrong.