-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
7 additions
and
29 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 |
---|---|---|
|
@@ -30,24 +30,16 @@ jobs: | |
runs-on: ubuntu-latest | ||
outputs: | ||
DENO_DIR: ${{ steps.deno-dir.outputs.DENO_DIR }} | ||
HAS_CODECOV_TOKEN: ${{ steps.secrets.outputs.CODECOV_TOKEN }} | ||
HAS_CODECOV_TOKEN: ${{ steps.secrets.outputs.HAS_CODECOV_TOKEN }} | ||
steps: | ||
- id: deno-dir | ||
name: Get cache directory | ||
run: | | ||
echo "DENO_DIR=${{ runner.temp }}/deno_dir" >> $GITHUB_OUTPUT; | ||
- id: secrets | ||
name: Get secrets | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
name: Check secrets | ||
run: | | ||
if [ "${{ secrets.CODECOV_TOKEN }}" != "" ] | ||
then | ||
echo "Has codecov"; | ||
echo "CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }}" >> $GITHUB_OUTPUT; | ||
else | ||
echo "does not have codecov"; | ||
fi | ||
echo "HAS_CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN != '' }}" >> $GITHUB_OUTPUT; | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
|
@@ -86,20 +78,6 @@ jobs: | |
APP_ENV: test | ||
DENO_DIR: ${{ needs.variables.outputs.DENO_DIR }} | ||
steps: | ||
- id: variables | ||
name: Test variables | ||
run: | | ||
echo "Hello World!"; | ||
echo "DENO_DIR from variables = ${{ needs.variables.outputs.DENO_DIR }}"; | ||
echo "DENO_DIR from variables = ${{ needs.variables.outputs.DENO_DIR != '' }}"; | ||
echo "DENO_DIR from env = ${{ env.DENO_DIR }}"; | ||
echo "DENO_DIR from env = ${{ env.DENO_DIR != '' }}"; | ||
echo "CODECOV_TOKEN from variables = ${{ needs.variables.outputs.CODECOV_TOKEN }}"; | ||
echo "CODECOV_TOKEN from variables = ${{ needs.variables.outputs.CODECOV_TOKEN != '' }}"; | ||
echo "CODECOV_TOKEN from secrets = ${{ secrets.CODECOV_TOKEN }}"; | ||
echo "CODECOV_TOKEN from secrets = ${{ secrets.CODECOV_TOKEN != '' }}"; | ||
echo "FAKE from secrets = ${{ secrets.FAKE }}"; | ||
echo "FAKE from secrets = ${{ secrets.FAKE != '' }}"; | ||
- name: Clone repository | ||
uses: actions/[email protected] | ||
- name: Setup deno | ||
|
@@ -119,19 +97,19 @@ jobs: | |
working-directory: ${{ inputs.working-directory }} | ||
if: | | ||
matrix.os != 'ubuntu-latest' | ||
|| needs.variables.outputs.CODECOV_TOKEN == '' | ||
|| needs.variables.outputs.HAS_CODECOV_TOKEN == 'true' | ||
run: deno test ${{ inputs.test-args }} . | ||
- name: Run tests and collect coverage | ||
working-directory: ${{ inputs.working-directory }} | ||
if: | | ||
matrix.os == 'ubuntu-latest' | ||
&& needs.variables.outputs.CODECOV_TOKEN != '' | ||
&& needs.variables.outputs.HAS_CODECOV_TOKEN == 'false' | ||
run: deno test --coverage=cov ${{ inputs.test-args }} . | ||
- name: Generate coverage | ||
working-directory: ${{ inputs.working-directory }} | ||
if: | | ||
matrix.os == 'ubuntu-latest' | ||
&& needs.variables.outputs.CODECOV_TOKEN != '' | ||
&& needs.variables.outputs.HAS_CODECOV_TOKEN == 'false' | ||
run: deno coverage --lcov ${{ inputs.test-args }} > cov.lcov | ||
- name: Upload coverage | ||
uses: codecov/codecov-action@v3 | ||
|
@@ -141,4 +119,4 @@ jobs: | |
fail_ci_if_error: true | ||
if: | | ||
matrix.os == 'ubuntu-latest' | ||
&& needs.variables.outputs.CODECOV_TOKEN | ||
&& needs.variables.outputs.HAS_CODECOV_TOKEN == 'true' |